RetroArch
audio.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 audio.h -- Audio subsystem
4 
5 Copyright (C) 2004
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
8 
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
12 
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
16 
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
21 
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source
26 distribution.
27 
28 
29 
30 -------------------------------------------------------------*/
31 
32 
33 #ifndef __AUDIO_H__
34 #define __AUDIO_H__
35 
41 #include <gctypes.h>
42 
48 #define AI_STREAM_STOP 0x00000000
49 #define AI_STREAM_START 0x00000001
62 #define AI_SAMPLERATE_32KHZ 0x00000000
63 #define AI_SAMPLERATE_48KHZ 0x00000001
69 #ifdef __cplusplus
70  extern "C" {
71 #endif /* __cplusplus */
72 
79 typedef void (*AIDCallback)(void);
80 
81 
88 typedef void (*AISCallback)(u32 smp_cnt);
89 
90 
100 
101 
110 void AUDIO_Init(u8 *stack);
111 
112 
121 void AUDIO_SetStreamVolLeft(u8 vol);
122 
123 
131 
132 
141 void AUDIO_SetStreamVolRight(u8 vol);
142 
143 
151 
152 
161 void AUDIO_SetStreamSampleRate(u32 rate);
162 
163 
171 
172 
185 
186 
196 void AUDIO_InitDMA(u32 startaddr,u32 len);
197 
198 
206 
207 
217 void AUDIO_StartDMA();
218 
219 
226 void AUDIO_StopDMA();
227 
228 
236 
237 
245 
246 
254 
255 
264 void AUDIO_SetStreamTrigger(u32 cnt);
265 
266 
274 
275 
284 void AUDIO_SetDSPSampleRate(u8 rate);
285 
286 
294 
295 
305 
306 
314 
315 #ifdef __cplusplus
316  }
317 #endif /* __cplusplus */
318 
319 #endif
u8 AUDIO_GetStreamVolLeft()
Get streaming volume of the left channel.
u32 AUDIO_GetDMALength()
Get the DMA transfer length configured in the audio DMA interface.
Definition: audio.c:363
void AUDIO_ResetStreamSampleCnt()
Reset the stream sample count register.
u32 AUDIO_GetStreamSampleRate()
Get streaming sample rate.
Data type definitions.
u8 AUDIO_GetStreamVolRight()
Get streaming volume of the right channel.
GLenum GLsizei len
Definition: glext.h:7389
void AUDIO_SetStreamVolLeft(u8 vol)
Set streaming volume on the left channel.
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void AUDIO_Init(u8 *stack)
Initialize the AUDIO subsystem.
Definition: audio.c:199
u16 AUDIO_GetDMAEnableFlag()
Get the audio DMA flag.
Definition: audio.c:338
void callback(s32 result, dvdcmdblk *block)
Definition: dvd.c:2293
void AUDIO_SetDSPSampleRate(u8 rate)
Set the sampling rate for the DSP interface.
Definition: audio.c:368
void AUDIO_SetStreamPlayState(u32 state)
Set the play state for the streaming audio interface.
void AUDIO_StopDMA()
Stop the previously started audio DMA operation.
Definition: audio.c:348
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
u32 AUDIO_GetDSPSampleRate()
Get the sampling rate for the DSP interface.
Definition: audio.c:383
void AUDIO_SetStreamSampleRate(u32 rate)
Set streaming sample rate.
u32 AUDIO_GetDMAStartAddr()
Get the main memory address for the DMA operation.
Definition: audio.c:358
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
void(* AIDCallback)(void)
function pointer typedef for the user's Audio DMA interrupt callback
Definition: audio.h:79
void AUDIO_SetStreamTrigger(u32 cnt)
Set the sample count for the stream trigger.
AISCallback AUDIO_RegisterStreamCallback(AISCallback callback)
Register a user callback function for the AUDIO streaming interface.
void AUDIO_SetStreamVolRight(u8 vol)
set streaming volume of the right channel.
u32 AUDIO_GetStreamPlayState()
Get the play state from the streaming audio interface.
AIDCallback AUDIO_RegisterDMACallback(AIDCallback callback)
Register a user callback function for the audio DMA interface.
Definition: audio.c:315
void AUDIO_StartDMA()
Start the audio DMA operation.
Definition: audio.c:343
void AUDIO_InitDMA(u32 startaddr, u32 len)
Initialize an audio DMA transfer.
Definition: audio.c:327
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
void(* AISCallback)(u32 smp_cnt)
function pointer typedef for the user's Audio Streaming interrupt callback
Definition: audio.h:88
u32 AUDIO_GetDMABytesLeft()
Get the count of bytes, left to play, from the audio DMA interface.
Definition: audio.c:353