Dreambox C/C++ SDK v1.0.0
C/C++ SDK for creating Dreambox games
Loading...
Searching...
No Matches
db_audio.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5#ifdef __cplusplus
6extern "C"
7{
8#endif
9
10#define AUDIO_VOICEPARAM_VOLUME 0
11#define AUDIO_VOICEPARAM_PITCH 1
12#define AUDIO_VOICEPARAM_DETUNE 2
13#define AUDIO_VOICEPARAM_PAN 3
14#define AUDIO_VOICEPARAM_SAMPLEDATA 4
15#define AUDIO_VOICEPARAM_SAMPLERATE 5
16#define AUDIO_VOICEPARAM_LOOPENABLE 6
17#define AUDIO_VOICEPARAM_LOOPSTART 7
18#define AUDIO_VOICEPARAM_LOOPEND 8
19#define AUDIO_VOICEPARAM_RVBENABLE 9
20#define AUDIO_VOICEPARAM_FADEINLEN 10
21#define AUDIO_VOICEPARAM_FADEOUTLEN 11
22
23#define AUDIO_FMT_PCM_S8 0
24#define AUDIO_FMT_PCM_S16 1
25
31extern int32_t audio_alloc(const void *dataPtr, uint32_t dataLen, uint32_t audioFmt);
32
38extern int32_t audio_allocCompressed(const void *dataPtr, uint32_t dataLen, uint32_t blockSize);
39
42extern void audio_free(int32_t handle);
43
46extern uint32_t audio_getUsage();
47
51extern uint8_t audio_getVoiceState(uint32_t slot);
52
58extern void audio_queueSetParam_i(uint32_t slot, uint32_t param, int32_t value, double time);
59
65extern void audio_queueSetParam_f(uint32_t slot, uint32_t param, float value, double time);
66
70extern void audio_queueStartVoice(uint32_t slot, double time);
71
75extern void audio_queueStopVoice(uint32_t slot, double time);
76
79extern double audio_getTime();
80
87extern void audio_setReverbParams(float roomSize, float damp, float width, float wet, float dry);
88
93extern uint8_t audio_initSynth(void *sf2Data, uint32_t sf2DataLen);
94
100extern uint8_t audio_playMidi(void *smfData, uint32_t smfDataLen, uint8_t loop);
101
104extern void audio_setMidiVolume(float volume);
105
108extern void audio_setMidiReverb(uint8_t enabled);
109
110#ifdef __cplusplus
111}
112#endif
int32_t audio_allocCompressed(const void *dataPtr, uint32_t dataLen, uint32_t blockSize)
Upload IMA ADPCM compressed sample data to the audio system.
void audio_queueStartVoice(uint32_t slot, double time)
Schedule voice in the given slot to start playing.
void audio_free(int32_t handle)
Free previously allocated sample data.
double audio_getTime()
Get the current audio time.
void audio_queueSetParam_f(uint32_t slot, uint32_t param, float value, double time)
Schedule parameter change for voice in the given slot.
uint32_t audio_getUsage()
Get total audio memory usage.
void audio_setMidiVolume(float volume)
Set volume of MIDI playback.
uint8_t audio_playMidi(void *smfData, uint32_t smfDataLen, uint8_t loop)
Begin playing the given MIDI data via the synthesis engine.
int32_t audio_alloc(const void *dataPtr, uint32_t dataLen, uint32_t audioFmt)
Upload sample data to the audio system.
void audio_setMidiReverb(uint8_t enabled)
Set whether MIDI synthesis engine routes through globl reverb unit.
void audio_setReverbParams(float roomSize, float damp, float width, float wet, float dry)
Set the global reverb unit parameters for voices with reverb enabled.
uint8_t audio_initSynth(void *sf2Data, uint32_t sf2DataLen)
Initialize the MIDI synthesis engine with a soundfont.
void audio_queueSetParam_i(uint32_t slot, uint32_t param, int32_t value, double time)
Schedule parameter change for voice in the given slot.
void audio_queueStopVoice(uint32_t slot, double time)
Schedule voice in the given slot to stop playing.
uint8_t audio_getVoiceState(uint32_t slot)
Get the state of the voice in the given slot.