WAV Library


Data Structures

struct  pgeWav

Functions

int pgeWavInit (void)
void pgeWavShutdown (void)
pgeWavpgeWavLoad (const char *filename)
pgeWavpgeWavLoadMemory (unsigned char *buffer, int size)
void pgeWavDestroy (pgeWav *wav)
int pgeWavPlay (pgeWav *wav)
void pgeWavStop (pgeWav *wav)
void pgeWavStopAll (void)
int pgeWavIsPlaying (pgeWav *wav)
void pgeWavLoop (pgeWav *wav, unsigned int loop)
void pgeWavVolume (pgeWav *wav, unsigned char leftvolume, unsigned char rightvolume)
void pgeWavPitch (pgeWav *wav, float pitch)

Function Documentation

void pgeWavDestroy ( pgeWav wav  ) 

Destroy a previously loaded WAV file

Parameters:
wav - A valid pgeWav

int pgeWavInit ( void   ) 

Initialise the WAV playback

Returns:
1 on success.

int pgeWavIsPlaying ( pgeWav wav  ) 

Check if a WAV is playing

Parameters:
wav A pointer to a valid pgeWav struct.
Returns:
1 if playing, 0 if not.

pgeWav* pgeWavLoad ( const char *  filename  ) 

Load a WAV file

Parameters:
filename - Path of the file to load.
Returns:
A pointer to a pgeWav struct or NULL on error.

pgeWav* pgeWavLoadMemory ( unsigned char *  buffer,
int  size 
)

Load a WAV file from memory

Parameters:
buffer - Buffer that contains the WAV data.
size - Size of the buffer.
Returns:
A pointer to a pgeWav struct or NULL on error.

void pgeWavLoop ( pgeWav wav,
unsigned int  loop 
)

Set the loop of the WAV

Parameters:
wav - A pointer to a valid pgeWav struct.
loop - Set to 1 to loop, 0 to playback once.

void pgeWavPitch ( pgeWav wav,
float  pitch 
)

Set the pitch of the WAV

Parameters:
wav - A pointer to a valid pgeWav struct.
pitch - The new pitch.

int pgeWavPlay ( pgeWav wav  ) 

Start playing a loaded WAV file

Parameters:
wav A pointer to a valid pgeWav struct.
Returns:
1 on success.

void pgeWavShutdown ( void   ) 

Shutdown WAV playback

void pgeWavStop ( pgeWav wav  ) 

Stop playing a loaded WAV

Parameters:
wav A pointer to a valid pgeWav struct.
Returns:
1 on success.

void pgeWavStopAll ( void   ) 

Stop playing all WAVs

void pgeWavVolume ( pgeWav wav,
unsigned char  leftvolume,
unsigned char  rightvolume 
)

Set the volume of the WAV

Parameters:
wav - A pointer to a valid pgeWav struct.
leftvolume - Set to 0 for no volume, 100 for full volume.
rightvolume - Set to 0 for no volume, 100 for full volume.


Generated on Mon Sep 22 16:58:14 2008 for Phoenix Game Engine by  doxygen 1.5.5