10 #include "../audio/audio.h"
11 #include "../sf/service.h"
13 #define AUDREN_TIMER_FREQ_HZ 200.0f
14 #define AUDREN_TIMER_PERIOD_MS 5.0f
15 #define AUDREN_SAMPLES_PER_FRAME_32KHZ 160
16 #define AUDREN_SAMPLES_PER_FRAME_48KHZ 240
18 #define AUDREN_INPUT_PARAM_ALIGNMENT 0x1000
19 #define AUDREN_OUTPUT_PARAM_ALIGNMENT 0x10
20 #define AUDREN_MEMPOOL_ALIGNMENT 0x1000
21 #define AUDREN_BUFFER_ALIGNMENT 0x40
23 #define AUDREN_REVISION_1 0x31564552
24 #define AUDREN_REVISION_2 0x32564552
25 #define AUDREN_REVISION_3 0x33564552
26 #define AUDREN_REVISION_4 0x34564552
27 #define AUDREN_REVISION_5 0x35564552
28 #define AUDREN_REVISION_6 0x36564552
30 #define AUDREN_NODEID(_a,_b,_c) ((((u32)(_a) & 0xF) << 28) | (((u32)(_b) & 0xFFF) << 16) | ((u32)(_c) & 0xFFFF))
31 #define AUDREN_FINAL_MIX_ID 0
32 #define AUDREN_UNUSED_MIX_ID 0x7FFFFFFF
33 #define AUDREN_UNUSED_SPLITTER_ID 0xFFFFFFFF
35 #define AUDREN_DEFAULT_DEVICE_NAME "MainAudioOut"
38 AudioRendererOutputRate_32kHz,
39 AudioRendererOutputRate_48kHz,
40 } AudioRendererOutputRate;
43 AudioRendererOutputRate output_rate;
104 AudioRendererMemPoolState_Invalid,
105 AudioRendererMemPoolState_New,
106 AudioRendererMemPoolState_RequestDetach,
107 AudioRendererMemPoolState_Detached,
108 AudioRendererMemPoolState_RequestAttach,
109 AudioRendererMemPoolState_Attached,
110 AudioRendererMemPoolState_Released,
111 } AudioRendererMemPoolState;
116 AudioRendererMemPoolState state;
122 AudioRendererMemPoolState new_state;
141 u16 coefficients[16];
153 s32 start_sample_offset;
154 s32 end_sample_offset;
159 const void* context_addr;
165 AudioRendererVoicePlayState_Started,
166 AudioRendererVoicePlayState_Stopped,
167 AudioRendererVoicePlayState_Paused,
168 } AudioRendererVoicePlayState;
175 AudioRendererVoicePlayState state : 8;
188 const void* extra_params_ptr;
191 u32 dest_splitter_id;
198 u64 played_sample_count;
199 u32 num_wavebufs_consumed;
200 u32 voice_drops_count;
215 u32 dest_splitter_id;
224 AudioRendererSinkType_Invalid,
225 AudioRendererSinkType_Device,
226 AudioRendererSinkType_CircularBuffer,
227 } AudioRendererSinkType;
235 bool downmix_params_enabled;
244 u32 last_read_offset;
251 AudioRendererSinkType type : 8;
263 u32 last_written_offset;
279 static inline u32 audrenGetRevision(
void)
281 extern u32 g_audrenRevision;
282 return g_audrenRevision;
287 return config->num_effects + 4 * config->num_voices;
327 void audrenWaitFrame(
void);
329 Result audrenRequestUpdateAudioRenderer(
const void* in_param_buf,
size_t in_param_buf_size,
void* out_param_buf,
size_t out_param_buf_size,
void* perf_buf,
size_t perf_buf_size);
330 Result audrenStartAudioRenderer(
void);
331 Result audrenStopAudioRenderer(
void);
332 Result audrenSetAudioRendererRenderingTimeLimit(
int percent);
PcmFormat
PcmFormat.
Definition: audio.h:12
Service * audrenGetServiceSession_AudioRenderer(void)
Gets the Service object for IAudioRenderer.
void audrenExit(void)
Exit audren.
Result audrenInitialize(const AudioRendererConfig *config)
Initialize audren.
Service object structure.
Definition: service.h:14
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
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
#define NX_CONSTEXPR
Flags a function as constexpr in C++14 and above; or as (always) inline otherwise.
Definition: types.h:92
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21