Dreambox C/C++ SDK v1.0.0
C/C++ SDK for creating Dreambox games
|
Go to the source code of this file.
Data Structures | |
struct | sound_sample |
Represents a loaded sound sample. More... | |
struct | sound_emitter |
Struct containing the state of a sound emitter. More... | |
Macros | |
#define | SOUND_ATTEN_NONE 0 |
#define | SOUND_ATTEN_INV_DISTANCE 1 |
#define | SOUND_ATTEN_LINEAR 2 |
#define | SOUND_ATTEN_EXP_DISTANCE 3 |
Typedefs | |
typedef struct sound_emitter | sound_emitter |
Struct containing the state of a sound emitter. More... | |
Functions | |
void | sound_init () |
Initialize the sound driver. More... | |
void | sound_update () |
Update sound playback. More... | |
sound_sample | sound_loadWav (IOFILE *file) |
Load a sample from a .WAV file. More... | |
sound_sample | sound_loadWavBytes (const uint8_t *data) |
Load a sample from a .WAV file blob. More... | |
void | sound_playOneShot (uint8_t priority, sound_sample sample, uint8_t reverb, float volume, float pitch, float pan) |
Play a one-shot sample. More... | |
void | sound_playOneShot3D (uint8_t priority, sound_sample sample, uint8_t reverb, float volume, float pitch, Vec3 position, uint8_t attenModel, float attenMinDistance, float attenMaxDistance, float attenRolloff) |
Play a one-shot sample in 3D. More... | |
sound_emitter * | sound_play (uint8_t priority, sound_sample sample, uint8_t reverb, uint8_t loop, float volume, float pitch, float pan) |
Begin playing a sound, returning a pointer to the emitter. More... | |
sound_emitter * | sound_play3D (uint8_t priority, sound_sample sample, uint8_t reverb, uint8_t loop, float volume, float pitch, Vec3 position, uint8_t attenModel, float attenMinDistance, float attenMaxDistance, float attenRolloff) |
Begin playing a 3D sound, returning a pointer to the emitter. More... | |
void | sound_destroy (sound_emitter *voice) |
Destroy the sound emitter. More... | |
void | sound_stop (sound_emitter *voice) |
Stop playing the sound emitter. More... | |
void | sound_setPosition (sound_emitter *voice, Vec3 position) |
Update the position of the emitter. More... | |
void | sound_setListener (Vec3 listenerPosition, Quaternion listenerOrientation) |
Set the position and orientation of the listener. More... | |
#define SOUND_ATTEN_EXP_DISTANCE 3 |
Definition at line 16 of file db_sounddriver.h.
#define SOUND_ATTEN_INV_DISTANCE 1 |
Definition at line 14 of file db_sounddriver.h.
#define SOUND_ATTEN_LINEAR 2 |
Definition at line 15 of file db_sounddriver.h.
#define SOUND_ATTEN_NONE 0 |
Definition at line 13 of file db_sounddriver.h.
typedef struct sound_emitter sound_emitter |
Struct containing the state of a sound emitter.
void sound_destroy | ( | sound_emitter * | voice | ) |
Destroy the sound emitter.
voice | The emitter handle |
void sound_init | ( | ) |
Initialize the sound driver.
sound_sample sound_loadWav | ( | IOFILE * | file | ) |
Load a sample from a .WAV file.
file | Handle to the open WAV file |
sound_sample sound_loadWavBytes | ( | const uint8_t * | data | ) |
Load a sample from a .WAV file blob.
data | Pointer to the wav file bytes |
sound_emitter * sound_play | ( | uint8_t | priority, |
sound_sample | sample, | ||
uint8_t | reverb, | ||
uint8_t | loop, | ||
float | volume, | ||
float | pitch, | ||
float | pan | ||
) |
Begin playing a sound, returning a pointer to the emitter.
priority | The priority of the sound (0 is highest, 255 is lowest) |
sample | The sample to play |
reverb | Whether to apply reverb to the sound |
loop | Whether to loop the sample |
volume | The initial volume |
pitch | The initial pitch |
pan | The initial pan |
sound_emitter * sound_play3D | ( | uint8_t | priority, |
sound_sample | sample, | ||
uint8_t | reverb, | ||
uint8_t | loop, | ||
float | volume, | ||
float | pitch, | ||
Vec3 | position, | ||
uint8_t | attenModel, | ||
float | attenMinDistance, | ||
float | attenMaxDistance, | ||
float | attenRolloff | ||
) |
Begin playing a 3D sound, returning a pointer to the emitter.
priority | The priority of the sound (0 is highest, 255 is lowest) |
sample | The sample to play |
reverb | Whether to apply reverb to the sound |
loop | Whether to loop the sample |
volume | The initial volume |
pitch | The initial pitch |
position | The initial position of the emitter |
attenModel | The attenuation model of the emitter |
attenMinDistance | The min distance of the emitter |
attenMaxDistance | The max distance of the emitter |
attenRolloff | The rolloff factor of the emitter |
void sound_playOneShot | ( | uint8_t | priority, |
sound_sample | sample, | ||
uint8_t | reverb, | ||
float | volume, | ||
float | pitch, | ||
float | pan | ||
) |
Play a one-shot sample.
priority | The priority of the sound (0 is highest, 255 is lowest) |
sample | The sample to play |
reverb | Whether to apply reverb to the sound |
volume | The volume of the sound |
pitch | The pitch of the sound |
pan | The pan of the sound |
void sound_playOneShot3D | ( | uint8_t | priority, |
sound_sample | sample, | ||
uint8_t | reverb, | ||
float | volume, | ||
float | pitch, | ||
Vec3 | position, | ||
uint8_t | attenModel, | ||
float | attenMinDistance, | ||
float | attenMaxDistance, | ||
float | attenRolloff | ||
) |
Play a one-shot sample in 3D.
priority | The priority of the sound (0 is highest, 255 is lowest) |
sample | The sample to play |
reverb | Whether to apply reverb to the sound |
volume | The volume of the sound |
pitch | The pitch of the sound |
position | The position of the sound |
attenModel | The attenuation model of the sound |
attenMinDistance | The min distance of the sound |
attenMaxDistance | The max distance of the sound |
attenRolloff | The rolloff factor of the sound |
void sound_setListener | ( | Vec3 | listenerPosition, |
Quaternion | listenerOrientation | ||
) |
Set the position and orientation of the listener.
listenerPosition | The position of the listener |
listenerOrientation | The orientation of the listener |
void sound_setPosition | ( | sound_emitter * | voice, |
Vec3 | position | ||
) |
Update the position of the emitter.
voice | The emitter to update |
position | The new position |
void sound_stop | ( | sound_emitter * | voice | ) |
Stop playing the sound emitter.
voice | A pointer to the emitter |
void sound_update | ( | ) |
Update sound playback.