8 #include "../services/audren.h"
10 typedef struct AudioDriverEtc AudioDriverEtc;
28 int audrvMemPoolAdd(
AudioDriver* d,
void* buffer,
size_t size);
36 AudioDriverWaveBufState_Free,
37 AudioDriverWaveBufState_Waiting,
38 AudioDriverWaveBufState_Queued,
39 AudioDriverWaveBufState_Playing,
40 AudioDriverWaveBufState_Done,
41 } AudioDriverWaveBufState;
52 s32 start_sample_offset;
53 s32 end_sample_offset;
54 const void* context_addr;
56 AudioDriverWaveBufState state : 8;
62 bool audrvVoiceInit(
AudioDriver* d,
int id,
int num_channels,
PcmFormat format,
int sample_rate);
71 void audrvVoiceSetBiquadFilter(
AudioDriver* d,
int id,
int biquad_id,
float a0,
float a1,
float a2,
float b0,
float b1,
float b2);
73 static inline void audrvVoiceSetExtraParams(
AudioDriver* d,
int id,
const void* params,
size_t params_size)
75 d->in_voices[id].extra_params_ptr = params;
76 d->in_voices[id].extra_params_sz = params_size;
79 static inline void audrvVoiceSetDestinationMix(
AudioDriver* d,
int id,
int mix_id)
81 d->in_voices[id].dest_mix_id = mix_id;
82 d->in_voices[id].dest_splitter_id = AUDREN_UNUSED_SPLITTER_ID;
85 static inline void audrvVoiceSetMixFactor(
AudioDriver* d,
int id,
float factor,
int src_channel_id,
int dest_channel_id)
87 int channel_id = d->in_voices[id].channel_ids[src_channel_id];
88 d->in_channels[channel_id].mix[dest_channel_id] = factor;
91 static inline void audrvVoiceSetVolume(
AudioDriver* d,
int id,
float volume)
93 d->in_voices[id].volume = volume;
96 static inline void audrvVoiceSetPitch(
AudioDriver* d,
int id,
float pitch)
98 d->in_voices[id].pitch = pitch;
101 static inline void audrvVoiceSetPriority(
AudioDriver* d,
int id,
int priority)
103 d->in_voices[id].priority = priority;
106 static inline void audrvVoiceClearBiquadFilter(
AudioDriver* d,
int id,
int biquad_id)
108 d->in_voices[id].biquads[biquad_id].enable =
false;
111 static inline void audrvVoiceSetPaused(
AudioDriver* d,
int id,
bool paused)
113 d->in_voices[id].state = paused ? AudioRendererVoicePlayState_Paused : AudioRendererVoicePlayState_Started;
116 static inline void audrvVoiceStart(
AudioDriver* d,
int id)
118 audrvVoiceSetPaused(d,
id,
false);
123 int audrvMixAdd(
AudioDriver* d,
int sample_rate,
int num_channels);
126 static inline void audrvMixSetDestinationMix(
AudioDriver* d,
int id,
int mix_id)
128 d->in_mixes[id].dest_mix_id = mix_id;
129 d->in_mixes[id].dest_splitter_id = AUDREN_UNUSED_SPLITTER_ID;
132 static inline void audrvMixSetMixFactor(
AudioDriver* d,
int id,
float factor,
int src_channel_id,
int dest_channel_id)
134 d->in_mixes[id].mix[src_channel_id][dest_channel_id] = factor;
137 static inline void audrvMixSetVolume(
AudioDriver* d,
int id,
float volume)
139 d->in_mixes[id].volume = volume;
144 int audrvDeviceSinkAdd(
AudioDriver* d,
const char* device_name,
int num_channels,
const u8* channel_ids);
PcmFormat
PcmFormat.
Definition: audio.h:12
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
int16_t s16
16-bit signed integer.
Definition: types.h:26
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21