RetroArch
|
ASND library. More...
#include <gctypes.h>
Go to the source code of this file.
Typedefs | |
typedef void(* | ASNDVoiceCallback) (s32 voice) |
Callback type for ASND_SetVoice(). More... | |
Enumerations | |
enum | { NOTE_DO =0, NOTE_DOs, NOTE_REb =NOTE_DOs, NOTE_RE, NOTE_REs, NOTE_MIb =NOTE_REs, NOTE_MI, NOTE_FA, NOTE_FAs, NOTE_SOLb =NOTE_FAs, NOTE_SOL, NOTE_SOLs, NOTE_LAb =NOTE_SOLs, NOTE_LA, NOTE_LAs, NOTE_SIb =NOTE_LAs, NOTE_SI } |
enum | { NOTE_C =0, NOTE_Cs, NOTE_Db =NOTE_Cs, NOTE_D, NOTE_Ds, NOTE_Eb =NOTE_Ds, NOTE_E, NOTE_F, NOTE_Fs, NOTE_Gb =NOTE_Fs, NOTE_G, NOTE_Gs, NOTE_Ab =NOTE_Gs, NOTE_A, NOTE_As, NOTE_Bb =NOTE_As, NOTE_B } |
Functions | |
int | ANote2Freq (int note, int freq_base, int note_base) |
Initializes the SND lib and fixes the hardware sample rate. More... | |
void | ASND_Init () |
Initializes the ASND lib and fixes the hardware sample rate to 48000. More... | |
void | ASND_End () |
De-initializes the ASND lib. More... | |
void | ASND_Pause (s32 paused) |
Used to pause (or unpause) the sound. More... | |
s32 | ASND_Is_Paused () |
Returns sound paused status. More... | |
u32 | ASND_GetTime () |
Returns the global time. More... | |
u32 | ASND_GetSampleCounter () |
Retrieves the global sample counter. More... | |
u32 | ASND_GetSamplesPerTick () |
Retrieves the samples sent from the IRQ in one tick. More... | |
void | ASND_SetTime (u32 time) |
Set the global time. More... | |
void | ASND_SetCallback (void(*callback)()) |
Sets a global callback for general purposes. More... | |
s32 | ASND_GetAudioRate () |
Returns the current audio rate. More... | |
s32 | ASND_SetVoice (s32 voice, s32 format, s32 pitch, s32 delay, void *snd, s32 size_snd, s32 volume_l, s32 volume_r, ASNDVoiceCallback callback) |
Sets a PCM voice to play. More... | |
s32 | ASND_SetInfiniteVoice (s32 voice, s32 format, s32 pitch, s32 delay, void *snd, s32 size_snd, s32 volume_l, s32 volume_r) |
Sets a PCM voice to play infinitely. More... | |
s32 | ASND_AddVoice (s32 voice, void *snd, s32 size_snd) |
Adds a PCM voice to play from the second buffer. More... | |
s32 | ASND_StopVoice (s32 voice) |
Stops the selected voice. More... | |
s32 | ASND_PauseVoice (s32 voice, s32 pause) |
Pauses the selected voice. More... | |
s32 | ASND_StatusVoice (s32 voice) |
Returns the status of the selected voice. More... | |
s32 | ASND_GetFirstUnusedVoice () |
Returns the first unused voice. More... | |
s32 | ASND_ChangePitchVoice (s32 voice, s32 pitch) |
Changes the voice pitch in real-time. More... | |
s32 | ASND_ChangeVolumeVoice (s32 voice, s32 volume_l, s32 volume_r) |
Changes the voice volume in real-time. More... | |
u32 | ASND_GetTickCounterVoice (s32 voice) |
Returns the voice tick counter. More... | |
u32 | ASND_GetTimerVoice (s32 voice) |
Returns the voice playback time. More... | |
s32 | ASND_TestPointer (s32 voice, void *pointer) |
Tests if pointer is in use by voice as a buffer. More... | |
s32 | ASND_TestVoiceBufferReady (s32 voice) |
Tests to determine if the voice is ready to receive a new buffer sample with ASND_AddVoice(). More... | |
u32 | ASND_GetDSP_PercentUse () |
Returns the DSP usage. More... | |
u32 | ASND_GetDSP_ProcessTime () |
ASND library.
#define __SNDLIB_H__ |
#define ASND_LIB 0x100 |
#define SND_LIB (ASND_LIB+2) |
Callback type for ASND_SetVoice().
int ANote2Freq | ( | int | note, |
int | freq_base, | ||
int | note_base | ||
) |
Initializes the SND lib and fixes the hardware sample rate.
[in] | note | Note codification to play. for example: NOTE(C,4) for note C and octave 4. |
[in] | freq_base | Frequency base of the sample. For example 8000Hz. |
[in] | note_base | Note codification of the sample. For example: NOTE(L, 3) for note L and octave 3 (LA 3). |