Macros | |
#define | oslSetSoundEndCallback(s, fct) (s->endCallback = (fct)) |
#define | oslSetSoundLoop(s, loop) oslSetSoundEndCallback(s, (loop)?oslSoundLoopFunc:NULL) |
Enumerations | |
enum | oslInitAudioME_formats { OSL_FMT_AT3 = 1, OSL_FMT_MP3 = 2, OSL_FMT_ALL = 3 } |
Functions | |
void | oslPlaySound (OSL_SOUND *s, int voice) |
void | oslStopSound (OSL_SOUND *s) |
void | oslPauseSound (OSL_SOUND *s, int pause) |
void | oslDeleteSound (OSL_SOUND *s) |
void | oslAudioVSync () |
Audio player.
#define oslSetSoundEndCallback | ( | s, | |
fct | |||
) | (s->endCallback = (fct)) |
Sets the function to be called after a sound has finished to play.
The function has the following parameters: OSL_SOUND* (pointer to the sound), int (number of the voice). It must return the following value: 0 to destroy the channel, 1 to continue playback (imagine you play something else or replay the same song).
#define oslSetSoundLoop | ( | s, | |
loop | |||
) | oslSetSoundEndCallback(s, (loop)?oslSoundLoopFunc:NULL) |
Sets whether sound is looped or not. This is done by defining the same callback as in the example above.
Formats de fichier à initialiser pour oslInitAudioME.
Enumerator | |
---|---|
OSL_FMT_AT3 |
Atrac3 and Atrac3+. |
OSL_FMT_MP3 |
Mpeg Audio-Layer 3. |
OSL_FMT_ALL |
All formats. |
void oslPlaySound | ( | OSL_SOUND * | s, |
int | voice | ||
) |
Plays a sound on the specified channel. The channel is the channel number from 0 to 7. Playing a sound on an active channel stops the currently playing sound. The advantage of having 8 channels is that you can play up to 8 sounds at the same time.
void oslStopSound | ( | OSL_SOUND * | s | ) |
Stops a sound currently playing.
void oslPauseSound | ( | OSL_SOUND * | s, |
int | pause | ||
) |
Pauses a sound.
s | Sound to pause or resume. |
pause |
|
void oslDeleteSound | ( | OSL_SOUND * | s | ) |
Deletes a sound, freeing associated memory. If the sound is currently being played, it will be stopped.
void oslAudioVSync | ( | ) |
Call this in your loop if a file is streamed and the PSP can go in stand-by mode. If you forget to call this often enough, the sound will not resume after a return from stand-by.
Important: This function is called by oslEndFrame, so you don't need to do it twice if you've added a oslEndFrame call to your code. Consider using oslEndFrame instead of oslAudioVSync for your new projects, as it's cleaner.