Dreambox C/C++ SDK v1.0.0
C/C++ SDK for creating Dreambox games
|
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | AUDIO_VOICEPARAM_VOLUME 0 |
#define | AUDIO_VOICEPARAM_PITCH 1 |
#define | AUDIO_VOICEPARAM_DETUNE 2 |
#define | AUDIO_VOICEPARAM_PAN 3 |
#define | AUDIO_VOICEPARAM_SAMPLEDATA 4 |
#define | AUDIO_VOICEPARAM_SAMPLERATE 5 |
#define | AUDIO_VOICEPARAM_LOOPENABLE 6 |
#define | AUDIO_VOICEPARAM_LOOPSTART 7 |
#define | AUDIO_VOICEPARAM_LOOPEND 8 |
#define | AUDIO_VOICEPARAM_RVBENABLE 9 |
#define | AUDIO_VOICEPARAM_FADEINLEN 10 |
#define | AUDIO_VOICEPARAM_FADEOUTLEN 11 |
#define | AUDIO_FMT_PCM_S8 0 |
#define | AUDIO_FMT_PCM_S16 1 |
Functions | |
int32_t | audio_alloc (const void *dataPtr, uint32_t dataLen, uint32_t audioFmt) |
Upload sample data to the audio system. More... | |
int32_t | audio_allocCompressed (const void *dataPtr, uint32_t dataLen, uint32_t blockSize) |
Upload IMA ADPCM compressed sample data to the audio system. More... | |
void | audio_free (int32_t handle) |
Free previously allocated sample data. More... | |
uint32_t | audio_getUsage () |
Get total audio memory usage. More... | |
uint8_t | audio_getVoiceState (uint32_t slot) |
Get the state of the voice in the given slot. More... | |
void | audio_queueSetParam_i (uint32_t slot, uint32_t param, int32_t value, double time) |
Schedule parameter change for voice in the given slot. More... | |
void | audio_queueSetParam_f (uint32_t slot, uint32_t param, float value, double time) |
Schedule parameter change for voice in the given slot. More... | |
void | audio_queueStartVoice (uint32_t slot, double time) |
Schedule voice in the given slot to start playing. More... | |
void | audio_queueStopVoice (uint32_t slot, double time) |
Schedule voice in the given slot to stop playing. More... | |
double | audio_getTime () |
Get the current audio time. More... | |
void | audio_setReverbParams (float roomSize, float damp, float width, float wet, float dry) |
Set the global reverb unit parameters for voices with reverb enabled. More... | |
uint8_t | audio_initSynth (void *sf2Data, uint32_t sf2DataLen) |
Initialize the MIDI synthesis engine with a soundfont. More... | |
uint8_t | audio_playMidi (void *smfData, uint32_t smfDataLen, uint8_t loop) |
Begin playing the given MIDI data via the synthesis engine. More... | |
void | audio_setMidiVolume (float volume) |
Set volume of MIDI playback. More... | |
void | audio_setMidiReverb (uint8_t enabled) |
Set whether MIDI synthesis engine routes through globl reverb unit. More... | |
#define AUDIO_FMT_PCM_S16 1 |
Definition at line 24 of file db_audio.h.
#define AUDIO_FMT_PCM_S8 0 |
Definition at line 23 of file db_audio.h.
#define AUDIO_VOICEPARAM_DETUNE 2 |
Definition at line 12 of file db_audio.h.
#define AUDIO_VOICEPARAM_FADEINLEN 10 |
Definition at line 20 of file db_audio.h.
#define AUDIO_VOICEPARAM_FADEOUTLEN 11 |
Definition at line 21 of file db_audio.h.
#define AUDIO_VOICEPARAM_LOOPENABLE 6 |
Definition at line 16 of file db_audio.h.
#define AUDIO_VOICEPARAM_LOOPEND 8 |
Definition at line 18 of file db_audio.h.
#define AUDIO_VOICEPARAM_LOOPSTART 7 |
Definition at line 17 of file db_audio.h.
#define AUDIO_VOICEPARAM_PAN 3 |
Definition at line 13 of file db_audio.h.
#define AUDIO_VOICEPARAM_PITCH 1 |
Definition at line 11 of file db_audio.h.
#define AUDIO_VOICEPARAM_RVBENABLE 9 |
Definition at line 19 of file db_audio.h.
#define AUDIO_VOICEPARAM_SAMPLEDATA 4 |
Definition at line 14 of file db_audio.h.
#define AUDIO_VOICEPARAM_SAMPLERATE 5 |
Definition at line 15 of file db_audio.h.
#define AUDIO_VOICEPARAM_VOLUME 0 |
Definition at line 10 of file db_audio.h.
int32_t audio_alloc | ( | const void * | dataPtr, |
uint32_t | dataLen, | ||
uint32_t | audioFmt | ||
) |
Upload sample data to the audio system.
dataPtr | Pointer to the audio data to upload |
dataLen | Length of the audio data buffer |
audioFmt | Format of the data to upload (valid values are AUDIO_FMT_PCM_S8 or AUDIO_FMT_PCM_S16) |
int32_t audio_allocCompressed | ( | const void * | dataPtr, |
uint32_t | dataLen, | ||
uint32_t | blockSize | ||
) |
Upload IMA ADPCM compressed sample data to the audio system.
dataPtr | Pointer to the audio data to upload |
dataLen | Length of the audio data buffer |
blockSize | Length of each block of data |
void audio_free | ( | int32_t | handle | ) |
Free previously allocated sample data.
handle | A handle previously returned from audio_alloc |
double audio_getTime | ( | ) |
Get the current audio time.
uint32_t audio_getUsage | ( | ) |
Get total audio memory usage.
uint8_t audio_getVoiceState | ( | uint32_t | slot | ) |
Get the state of the voice in the given slot.
slot | The voice slot (0 to 31) |
uint8_t audio_initSynth | ( | void * | sf2Data, |
uint32_t | sf2DataLen | ||
) |
Initialize the MIDI synthesis engine with a soundfont.
sf2Data | Pointer to the SF2 data to load |
sf2DataLen | Length of the SF2 data blob |
uint8_t audio_playMidi | ( | void * | smfData, |
uint32_t | smfDataLen, | ||
uint8_t | loop | ||
) |
Begin playing the given MIDI data via the synthesis engine.
smfData | Pointer to the standard midi file data to load |
smfDataLen | Length of the standard midi file data blob |
loop | Whether to loop midi playback to either the beginning or a specified loop point (marked with CC#111) |
void audio_queueSetParam_f | ( | uint32_t | slot, |
uint32_t | param, | ||
float | value, | ||
double | time | ||
) |
Schedule parameter change for voice in the given slot.
slot | The voice slot (0 to 31) |
param | The parameter to change (one of the AUDIO_VOICEPARAM_* enumerations) |
value | The value to set the parameter to |
time | The time at which to change the parameter |
void audio_queueSetParam_i | ( | uint32_t | slot, |
uint32_t | param, | ||
int32_t | value, | ||
double | time | ||
) |
Schedule parameter change for voice in the given slot.
slot | The voice slot (0 to 31) |
param | The parameter to change (one of the AUDIO_VOICEPARAM_* enumerations) |
value | The value to set the parameter to |
time | The time at which to change the parameter |
void audio_queueStartVoice | ( | uint32_t | slot, |
double | time | ||
) |
Schedule voice in the given slot to start playing.
slot | The voice slot (0 to 31) |
time | The time at which to start playing |
void audio_queueStopVoice | ( | uint32_t | slot, |
double | time | ||
) |
Schedule voice in the given slot to stop playing.
slot | The voice slot (0 to 31) |
time | The time at which to stop playing |
void audio_setMidiReverb | ( | uint8_t | enabled | ) |
Set whether MIDI synthesis engine routes through globl reverb unit.
enabled | true to enable reverb, false otherwise |
void audio_setMidiVolume | ( | float | volume | ) |
Set volume of MIDI playback.
volume | New volume to set |
void audio_setReverbParams | ( | float | roomSize, |
float | damp, | ||
float | width, | ||
float | wet, | ||
float | dry | ||
) |
Set the global reverb unit parameters for voices with reverb enabled.
roomSize | The room size (values >1 may be unstable. default is 0.5) |
damp | Damping to apply (default is 0.5) |
width | Stereo width of the reverb (default is 1.0) |
wet | The gain of the wet signal (default is 0.2) |
dry | The gain of the dry signal (default is 0.8) |