KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
stream.h File Reference

Sound streaming support. More...

#include <sys/cdefs.h>
#include <arch/types.h>

Go to the source code of this file.

Macros

#define SND_STREAM_MAX   4
 The maximum number of streams that can be allocated at once.
 
#define SND_STREAM_BUFFER_MAX   0x10000
 The maximum buffer size for a stream.
 
#define SND_STREAM_INVALID   -1
 Invalid stream handle.
 

Typedefs

typedef int snd_stream_hnd_t
 Stream handle type.
 
typedef void *(* snd_stream_callback_t) (snd_stream_hnd_t hnd, int smp_req, int *smp_recv)
 Stream get data callback type.
 
typedef size_t(* snd_stream_callback_direct_t) (snd_stream_hnd_t hnd, uintptr_t left, uintptr_t right, size_t size_req)
 Direct stream data transfer callback type.
 
typedef void(* snd_stream_filter_t) (snd_stream_hnd_t hnd, void *obj, int hz, int channels, void **buffer, int *samplecnt)
 Stream filter callback type.
 

Functions

void snd_stream_set_callback (snd_stream_hnd_t hnd, snd_stream_callback_t cb)
 Set the callback for a given stream.
 
void snd_stream_set_callback_direct (snd_stream_hnd_t hnd, snd_stream_callback_direct_t cb)
 Set the callback for a given stream with direct transfer.
 
void snd_stream_set_userdata (snd_stream_hnd_t hnd, void *d)
 Set the user data for a given stream.
 
void * snd_stream_get_userdata (snd_stream_hnd_t hnd)
 Get the user data for a given stream.
 
void snd_stream_filter_add (snd_stream_hnd_t hnd, snd_stream_filter_t filtfunc, void *obj)
 Add a filter to the specified stream.
 
void snd_stream_filter_remove (snd_stream_hnd_t hnd, snd_stream_filter_t filtfunc, void *obj)
 Remove a filter from the specified stream.
 
void snd_stream_prefill (snd_stream_hnd_t hnd)
 Prefill the stream buffers.
 
int snd_stream_init (void)
 Initialize the stream system.
 
int snd_stream_init_ex (int channels, size_t buffer_size)
 Initialize the stream system with limits.
 
void snd_stream_shutdown (void)
 Shut down the stream system.
 
snd_stream_hnd_t snd_stream_alloc (snd_stream_callback_t cb, int bufsize)
 Allocate a stream.
 
int snd_stream_reinit (snd_stream_hnd_t hnd, snd_stream_callback_t cb)
 Reinitialize a stream.
 
void snd_stream_destroy (snd_stream_hnd_t hnd)
 Destroy a stream.
 
void snd_stream_queue_enable (snd_stream_hnd_t hnd)
 Enable queueing on a stream.
 
void snd_stream_queue_disable (snd_stream_hnd_t hnd)
 Disable queueing on a stream.
 
void snd_stream_queue_go (snd_stream_hnd_t hnd)
 Start a stream after queueing the request.
 
void snd_stream_start (snd_stream_hnd_t hnd, uint32 freq, int st)
 Start a 16-bit PCM stream.
 
void snd_stream_start_pcm8 (snd_stream_hnd_t hnd, uint32 freq, int st)
 Start a 8-bit PCM stream.
 
void snd_stream_start_adpcm (snd_stream_hnd_t hnd, uint32 freq, int st)
 Start a 4-bit ADPCM stream.
 
void snd_stream_stop (snd_stream_hnd_t hnd)
 Stop a stream.
 
int snd_stream_poll (snd_stream_hnd_t hnd)
 Poll a stream.
 
void snd_stream_volume (snd_stream_hnd_t hnd, int vol)
 Set the volume on the stream.
 
void snd_stream_pan (snd_stream_hnd_t hnd, int left_pan, int right_pan)
 Set the panning on the stream.
 

Detailed Description

Sound streaming support.

This file contains declarations for doing streams of sound. This underlies pretty much any decoded sounds you might use, including the Ogg Vorbis libraries. Note that this does not actually handle decoding, so you'll have to worry about that yourself (or use something in kos-ports).

Author
Megan Potter
Florian Schulze
Lawrence Sebald
Ruslan Rostovtsev