RetroArch
aesndlib.h
Go to the documentation of this file.
1 #ifndef __AESNDLIB_H__
2 #define __AESNDLIB_H__
3 
4 #include <gctypes.h>
5 
6 #define MAX_VOICES 32
7 #define SND_BUFFERSIZE 384 // output 2ms sound data at 48KHz
8 #define DSP_STREAMBUFFER_SIZE 1152 // input 2ms sound data at max. 144KHz
9 
10 #if defined(HW_DOL)
11  #define DSP_DEFAULT_FREQ 48044
12 #elif defined(HW_RVL)
13  #define DSP_DEFAULT_FREQ 48000
14 #endif
15 
16 #define VOICE_STATE_STOPPED 0
17 #define VOICE_STATE_RUNNING 1
18 #define VOICE_STATE_STREAM 2
19 
20 #define VOICE_MONO8 0x00000000
21 #define VOICE_STEREO8 0x00000001
22 #define VOICE_MONO16 0x00000002
23 #define VOICE_STEREO16 0x00000003
24 
25 #define VOICE_FREQ32KHZ 32000
26 #define VOICE_FREQ48KHZ 48000
27 
28 #ifdef __cplusplus
29  extern "C" {
30 #endif
31 
32 typedef struct aesndpb_t AESNDPB;
33 
35 typedef void (*AESNDAudioCallback)(void *audio_buffer,u32 len);
36 
37 void AESND_Init();
38 void AESND_Reset();
39 void AESND_Pause(bool pause);
43 
45 void AESND_FreeVoice(AESNDPB *pb);
46 void AESND_SetVoiceStop(AESNDPB *pb,bool stop);
47 void AESND_SetVoiceMute(AESNDPB *pb,bool mute);
48 void AESND_SetVoiceLoop(AESNDPB *pb,bool loop);
50 void AESND_SetVoiceStream(AESNDPB *pb,bool stream);
51 void AESND_SetVoiceFrequency(AESNDPB *pb,u32 freq);
52 void AESND_SetVoiceVolume(AESNDPB *pb,u16 volume_l,u16 volume_r);
53 void AESND_SetVoiceBuffer(AESNDPB *pb,const void *buffer,u32 len);
54 void AESND_PlayVoice(AESNDPB *pb,u32 format,const void *buffer,u32 len,u32 freq,u32 delay,bool looped);
56 
57 #ifdef __cplusplus
58  }
59 #endif
60 
61 #endif
struct aesndpb_t AESNDPB
Definition: aesndlib.h:32
void AESND_SetVoiceStream(AESNDPB *pb, bool stream)
AESNDVoiceCallback AESND_RegisterVoiceCallback(AESNDPB *pb, AESNDVoiceCallback cb)
void AESND_SetVoiceFormat(AESNDPB *pb, u32 format)
Data type definitions.
float f32
Definition: gctypes.h:43
GLenum GLsizei len
Definition: glext.h:7389
void AESND_Pause(bool pause)
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void(* AESNDVoiceCallback)(AESNDPB *pb, u32 state)
Definition: aesndlib.h:34
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
void AESND_SetVoiceBuffer(AESNDPB *pb, const void *buffer, u32 len)
void(* AESNDAudioCallback)(void *audio_buffer, u32 len)
Definition: aesndlib.h:35
void AESND_SetVoiceLoop(AESNDPB *pb, bool loop)
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
void AESND_SetVoiceVolume(AESNDPB *pb, u16 volume_l, u16 volume_r)
void AESND_SetVoiceMute(AESNDPB *pb, bool mute)
AESNDAudioCallback AESND_RegisterAudioCallback(AESNDAudioCallback cb)
void AESND_FreeVoice(AESNDPB *pb)
void AESND_SetVoiceFrequency(AESNDPB *pb, u32 freq)
void AESND_Reset()
GLuint GLuint stream
Definition: glext.h:8189
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
void AESND_Init()
void AESND_PlayVoice(AESNDPB *pb, u32 format, const void *buffer, u32 len, u32 freq, u32 delay, bool looped)
AESNDPB * AESND_AllocateVoice(AESNDVoiceCallback cb)
Definition: video4linux2.c:51
f32 AESND_GetDSPProcessUsage()
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
void AESND_SetVoiceStop(AESNDPB *pb, bool stop)
u32 AESND_GetDSPProcessTime()