#include "CrabClaw/types.h"Defines | |
| #define | CC_MIXER_BUFFER_BYTES 16384 |
| #define | CC_MIXER_FMT_16BIT_MONO 3 |
| 16-bit Mono stream type. | |
| #define | CC_MIXER_FMT_16BIT_STEREO 4 |
| 16-bit Stereo stream type. | |
| #define | CC_MIXER_FMT_8BIT_MONO 1 |
| 8-bit Mono stream type. | |
| #define | CC_MIXER_FMT_8BIT_STEREO 2 |
| 8-bit Stereo stream type. | |
Typedefs | |
| typedef int(* | cc_stream_update )(void *user, int smp_req, void **data) |
| Stream update function type. | |
Functions | |
| int | cc_mixer_init (void) |
| Initialize CrabClaw's mixer. | |
| void | cc_mixer_shutdown (void) |
| Shut down CrabClaw's mixer. | |
| int | cc_mixer_stream_start (uint32 fmt, int freq, cc_stream_update func, void *data, void **stream) |
| Start a new CrabClaw stream. | |
| int | cc_mixer_stream_stop (void *stream) |
| Stop a CrabClaw stream. | |
| void | cc_mixer_update (void) |
| Update all sound streams in progress. | |
| #define CC_MIXER_BUFFER_BYTES 16384 |
| #define CC_MIXER_FMT_16BIT_MONO 3 |
16-bit Mono stream type.
| #define CC_MIXER_FMT_16BIT_STEREO 4 |
16-bit Stereo stream type.
| #define CC_MIXER_FMT_8BIT_MONO 1 |
8-bit Mono stream type.
| #define CC_MIXER_FMT_8BIT_STEREO 2 |
8-bit Stereo stream type.
| typedef int(* cc_stream_update)(void *user, int smp_req, void **data) |
Stream update function type.
This is the type of the functions used to update a stream in CrabClaw.
| user | Data with no purpose to the mixer, only used by user code. | |
| smp_req | The number of samples that the mixer requests. | |
| data | The buffer with sound data in it. This must be provided by the function itself -- CrabClaw does not allocate the buffer automatically (nor does it free the buffer). |
| int cc_mixer_init | ( | void | ) |
Initialize CrabClaw's mixer.
This function initializes the sound system in use in CrabClaw.
| void cc_mixer_shutdown | ( | void | ) |
Shut down CrabClaw's mixer.
This function deinitializes the sound system in use in CrabClaw.
| int cc_mixer_stream_start | ( | uint32 | fmt, | |
| int | freq, | |||
| cc_stream_update | func, | |||
| void * | data, | |||
| void ** | stream | |||
| ) |
Start a new CrabClaw stream.
This function allocates resources for a stream to be started with the given parameters.
| fmt | The format of the sound generated by the stream. | |
| freq | The samplerate of the sound generated by the stream. | |
| func | The function that should be called to update the stream. | |
| data | The user-specific data to be passed to func. | |
| stream | A pointer to be used by the program to recognize the stream. |
| int cc_mixer_stream_stop | ( | void * | stream | ) |
Stop a CrabClaw stream.
This function stops the given stream from playing and frees all resources associated with it.
| stream | The stream to stop. |
| void cc_mixer_update | ( | void | ) |
Update all sound streams in progress.
This function updates all of the sound streams that have been started by the program. This function must be called periodically to poll for new sound data.