CRM32Pro_ISoundFX Class Reference
[MODULE 15: ISoundFX v4.20, sound,music and FX effects interface]

ISoundFX. More...


Detailed Description

ISoundFX.

Sound,music and FX effects interface.

List of all members.

Public Member Functions

void AllocateChannels (int nch)
 Dinamic change of channels.
int ChannelFadeIn (int ch, int hndSound, int loops, int ms)
 Channel fade in.
int ChannelFadeOut (int ch, int ms)
 Channel fade out.
int ChannelIsPaused (int ch)
 Query if a channel is paused.
void ChannelPause (int ch)
 Channel pause.
void ChannelResume (int ch)
 Channel resume.
void ChannelStop (int ch)
 Channel stop.
void ChannelVolume (int ch, int vol)
 Channel volumen control.
unsigned char Export (int idDPF, char *namesnd, char m, char *s=NULL)
 Exporting audio from a DPF(using an idDPF) to an external file.
unsigned char Export (char *fileDPF, char *namesnd, char m, char *s=NULL)
 Exporting audio from a DPF(using a filename) to an external file.
unsigned char Init ()
 Try to initialize sound system according to CRM32Pro.Config.
unsigned char Init (int frequency, unsigned short format, int channels, int chunksize)
 Initialize sound system.
int Initialized ()
 Was sound system activated?
int IsPlaying (int ch)
 Check is playing a channel.
int IsPlaying (void)
 Check is playing music.
int MusicFadeIn (int hndMusic, int loops, int ms)
 Music fade in.
int MusicFadeOut (int ms)
 Music fade out.
void MusicFree (int hndMusic)
 Free a music.
int MusicImport (int idDPF, char *namemus, char *filemus)
 Save a XM,IT,MOD,S3M or OGG music to DPF file(using idDPF) from external file.
int MusicImport (char *fileDPF, char *namemus, char *filemus)
 Save a XM,IT,MOD,S3M or OGG music to DPF file(using filename) from external file.
unsigned char MusicInfo (int idDPF, char *namemus, sAudioType *mustype)
 Get information about given music track stored on DPF(using an idDPF) or file. Only supports OGG,XM,MOD,IT and S3M.
unsigned char MusicInfo (char *fileDPF, char *namemus, sAudioType *mustype)
 Get information about given music track stored on DPF(using an idDPF) or file. Only supports OGG,XM,MOD,IT and S3M.
int MusicIsPaused (void)
 Query if music is paused.
int MusicLoad (int idDPF, char *musname)
 Load XM,IT,S3M,MOD and OGG music from DPF file(using an idDPF).
int MusicLoad (char *fileDPF, char *musname)
 Load XM,IT,S3M,MOD and OGG music from DPF file(using a filename).
int MusicLoad (const char *f)
 Load XM,IT,S3M,MOD and OGG music from external file.
void MusicPause (void)
 Pause music.
int MusicPlay (int hndMusic, int loops)
 Play a music track (XM,S3M,MOD,IT or OGG).
void MusicResume (void)
 Resume music.
void MusicRewind (void)
 Rewind music.
void MusicStop (void)
 Music stop.
void MusicVolume (int vol)
 Music volume control.
void NoInit ()
 Turn off sound output.
void QuerySpec (int *freq, unsigned short *format, int *ch)
 Query sound system features.
void Quit (void)
 Close sound system.
void SoundFree (int hndSound)
 Free a sound.
int SoundImport (int idDPF, char *namesnd, char *filesnd)
 Save a WAV,VOC,AIFF and OGG sound to DPF(using an idDPF) file from external file.
int SoundImport (char *fileDPF, char *namesnd, char *filesnd)
 Save a WAV,VOC,AIFF and OGG sound to DPF(using a filename) file from external file.
unsigned char SoundInfo (int idDPF, char *namesnd, sAudioType *sndtype)
 Get information about given sound stored on DPF(an idDPF) or file. Only supports WAV,VOC,AIFF and OGG.
unsigned char SoundInfo (char *fileDPF, char *namesnd, sAudioType *sndtype)
 Get information about given sound stored on DPF or file. Only supports WAV,VOC,AIFF and OGG.
int SoundLoad (int idDPF, char *namesnd)
 Load WAV,VOC,AIFF and OGG sound from DPF(using an idDPF) file.
int SoundLoad (char *fileDPF, char *namesnd)
 Load WAV,VOC,AIFF and OGG sound from DPF(using a filename) file.
int SoundLoad (const char *f)
 Load WAV,VOC,AIFF and OGG sound from external file.
void SoundPlay (int ch, int hndSound, int loops)
 Play a sound.
void SoundVolume (int hndSound, int vol)
 Sound volume control.

Member Function Documentation

int CRM32Pro_ISoundFX::ChannelFadeIn ( int  ch,
int  hndSound,
int  loops,
int  ms 
)

Channel fade in.

Parameters:
ch channel to fade in
hndSound sound handle to play
loops play times, 0 unlimited
ms time in milliseconds
Returns:
0 Failed
1 Ok
int CRM32Pro_ISoundFX::ChannelFadeOut ( int  ch,
int  ms 
)

Channel fade out.

Parameters:
ch channel to fade out
ms time in milliseconds
Returns:
0 Failed
1 Ok
int CRM32Pro_ISoundFX::ChannelIsPaused ( int  ch  ) 

Query if a channel is paused.

Parameters:
ch channel to query its state
Returns:
1 means a paused channel,otherwise is playing
void CRM32Pro_ISoundFX::ChannelPause ( int  ch  ) 

Channel pause.

Parameters:
ch channel to pause
void CRM32Pro_ISoundFX::ChannelResume ( int  ch  ) 

Channel resume.

Parameters:
ch channel to resume
void CRM32Pro_ISoundFX::ChannelStop ( int  ch  ) 

Channel stop.

Parameters:
ch channel to stop
void CRM32Pro_ISoundFX::ChannelVolume ( int  ch,
int  vol 
)

Channel volumen control.

Parameters:
ch channel to adjust the volumen. -1 will set the volume for all allocated channels.
vol volumen from 0 to 255
unsigned char CRM32Pro_ISoundFX::Export ( int  idDPF,
char *  namesnd,
char  m,
char *  s = NULL 
)

Exporting audio from a DPF(using an idDPF) to an external file.

Parameters:
idDPF ID of the opened DPF
namesnd name of the sound or music. If it has '/' or '\', it will create the path.
m 0 if it is a sound and 1 if it is a music.
s by default, is NULL. Use it if you want to change the file name (an optional path) of output file.
Returns:
0 Failed
1 Ok
unsigned char CRM32Pro_ISoundFX::Export ( char *  fileDPF,
char *  namesnd,
char  m,
char *  s = NULL 
)

Exporting audio from a DPF(using a filename) to an external file.

Parameters:
fileDPF DPF file that contains the audio(sound or music)
namesnd name of the sound or music. If it has '/' or '\', it will create the path.
m 0 if it is a sound and 1 if it is a music.
s by default, is NULL. Use it if you want to change the file name (an optional path) of output file.
Returns:
0 Failed
1 Ok
unsigned char CRM32Pro_ISoundFX::Init (  ) 

Try to initialize sound system according to CRM32Pro.Config.

Returns:
-1 Failed
0 Audio is not enabled (CRM32Pro.Config.AudioEnable = 0)
1 Ok
unsigned char CRM32Pro_ISoundFX::Init ( int  frequency,
unsigned short  format,
int  nchannels,
int  chunksize 
)

Initialize sound system.

Parameters:
frequency frequency in Hz (11025,22050,44200)
format AUDIO_S8 to 8bits or AUDIO_S16 to 16bits sound resolution
nchannels 1 for mono, 2 for stereo, 4 for surround and 6 for surround with center and lfe
chunksize buffer size, use 4096 for normal operation
Returns:
0 Failed
1 Ok
Examples:
Example01_BasicCode.cpp, and SpacePong.cpp.
int CRM32Pro_ISoundFX::Initialized (  ) 

Was sound system activated?

Returns:
0 Is not active
1 Is active
int CRM32Pro_ISoundFX::IsPlaying ( int  ch  ) 

Check is playing a channel.

Parameters:
ch channel to check
Returns:
0 Channel is not playing
any other value, channel is playing
int CRM32Pro_ISoundFX::IsPlaying ( void   ) 

Check is playing music.

Returns:
0 Music is not playing
any other value, music is playing
Examples:
SpacePong.cpp.
int CRM32Pro_ISoundFX::MusicFadeIn ( int  hndMusic,
int  loops,
int  ms 
)

Music fade in.

Parameters:
hndMusic music handle to play
loops play times, 0 unlimited
ms time in milliseconds
Returns:
0 Failed
1 Ok
int CRM32Pro_ISoundFX::MusicFadeOut ( int  ms  ) 

Music fade out.

Parameters:
ms time in milliseconds
Returns:
0 Failed
1 Ok
Examples:
SpacePong.cpp.
void CRM32Pro_ISoundFX::MusicFree ( int  hndMusic  ) 

Free a music.

Parameters:
hndMusic music handle to be deleted
Examples:
SpacePong.cpp.
int CRM32Pro_ISoundFX::MusicImport ( int  idDPF,
char *  namemus,
char *  filemus 
)

Save a XM,IT,MOD,S3M or OGG music to DPF file(using idDPF) from external file.

Parameters:
idDPF ID of the opened DPF
namemus music name
filemus external file with the original music
Returns:
-1 Music already exists.
0 Failed.
any other positive value, Ok and packed size of the added music
int CRM32Pro_ISoundFX::MusicImport ( char *  fileDPF,
char *  namemus,
char *  filemus 
)

Save a XM,IT,MOD,S3M or OGG music to DPF file(using filename) from external file.

Parameters:
fileDPF DPF file to store the music
namemus music name
filemus external file with the original music
Returns:
-1 Music already exists.
0 Failed.
any other positive value, Ok and packed size of the added music
unsigned char CRM32Pro_ISoundFX::MusicInfo ( int  idDPF,
char *  namemus,
sAudioType mustype 
)

Get information about given music track stored on DPF(using an idDPF) or file. Only supports OGG,XM,MOD,IT and S3M.

Parameters:
idDPF ID of the opened DPF
namemus if idDPF is 0, this is the name of external file. Otherwise, this is music name
mustype pointer to sAudioType
Returns:
0 Failed
1 Ok
unsigned char CRM32Pro_ISoundFX::MusicInfo ( char *  fileDPF,
char *  namemus,
sAudioType mustype 
)

Get information about given music track stored on DPF(using an idDPF) or file. Only supports OGG,XM,MOD,IT and S3M.

Parameters:
fileDPF DPF file to look for the music
namemus if "fileDPF" is NULL, this is the name of external file. Otherwise, this is music name
mustype pointer to sAudioType
Returns:
0 Failed
1 Ok
int CRM32Pro_ISoundFX::MusicIsPaused ( void   ) 

Query if music is paused.

Returns:
1 means a paused music,otherwise is playing
int CRM32Pro_ISoundFX::MusicLoad ( int  idDPF,
char *  namemus 
)

Load XM,IT,S3M,MOD and OGG music from DPF file(using an idDPF).

Parameters:
idDPF ID of the opened DPF
namemus music name
Returns:
-1 Failed
any other value, the music handle
int CRM32Pro_ISoundFX::MusicLoad ( char *  fileDPF,
char *  namemus 
)

Load XM,IT,S3M,MOD and OGG music from DPF file(using a filename).

Parameters:
fileDPF DPF file that contains the music
namemus music name
Returns:
-1 Failed
any other value, the music handle
int CRM32Pro_ISoundFX::MusicLoad ( const char *  fname  ) 

Load XM,IT,S3M,MOD and OGG music from external file.

Parameters:
fname file that contains the music
Returns:
-1 Failed
any other value, the music handle
Examples:
SpacePong.cpp.
int CRM32Pro_ISoundFX::MusicPlay ( int  hnd,
int  loops 
)

Play a music track (XM,S3M,MOD,IT or OGG).

Parameters:
hnd music handle the sound
loops number of play times, 0 means forever.
Returns:
0 Failed
1 Ok
Examples:
SpacePong.cpp.
void CRM32Pro_ISoundFX::MusicVolume ( int  vol  ) 

Music volume control.

Parameters:
vol volume from 0 to 255
void CRM32Pro_ISoundFX::QuerySpec ( int *  freq,
unsigned short *  format,
int *  ch 
)

Query sound system features.

Parameters:
freq pointer to integer to get the frequency in Hz (11025,22050,44200)
format pointer to Uint16 to get the sound resolution (8bits or 16bits)
ch pointer to integer to get 0 to mono or 1 to stereo
void CRM32Pro_ISoundFX::Quit ( void   ) 

Close sound system.

Close the sound system.

void CRM32Pro_ISoundFX::SoundFree ( int  hndSound  ) 

Free a sound.

Parameters:
hndSound sound handle to be deleted
Examples:
Example01_BasicCode.cpp, and SpacePong.cpp.
int CRM32Pro_ISoundFX::SoundImport ( int  idDPF,
char *  namesnd,
char *  filesnd 
)

Save a WAV,VOC,AIFF and OGG sound to DPF(using an idDPF) file from external file.

Parameters:
idDPF ID of the opened DPF
namesnd sound name
filesnd external file with the original sound
Returns:
-1 Sound already exists.
0 Failed.
any other positive value, Ok and packed size of the added sound
int CRM32Pro_ISoundFX::SoundImport ( char *  fileDPF,
char *  namesnd,
char *  filesnd 
)

Save a WAV,VOC,AIFF and OGG sound to DPF(using a filename) file from external file.

Parameters:
fileDPF DPF file to store the sound
namesnd sound name
filesnd external file with the original sound
Returns:
-1 Sound already exists.
0 Failed.
any other positive value, Ok and packed size of the added sound
unsigned char CRM32Pro_ISoundFX::SoundInfo ( int  idDPF,
char *  namesnd,
sAudioType sndtype 
)

Get information about given sound stored on DPF(an idDPF) or file. Only supports WAV,VOC,AIFF and OGG.

Parameters:
idDPF ID of the opened DPF
namesnd if idDPF is 0, this is the name of an external file. Otherwise, this is sound name
sndtype pointer to sAudioType
Returns:
0 Failed
1 Ok
unsigned char CRM32Pro_ISoundFX::SoundInfo ( char *  fileDPF,
char *  namesnd,
sAudioType sndtype 
)

Get information about given sound stored on DPF or file. Only supports WAV,VOC,AIFF and OGG.

Parameters:
fileDPF DPF file to look for the sound
namesnd if "fileDPF" is NULL, this is the name of external file. Otherwise, this is sound name
sndtype pointer to sAudioType
Returns:
0 Failed
1 Ok
int CRM32Pro_ISoundFX::SoundLoad ( int  idDPF,
char *  namesnd 
)

Load WAV,VOC,AIFF and OGG sound from DPF(using an idDPF) file.

Parameters:
idDPF ID of the opened DPF
namesnd sound name
Returns:
-1 Failed
any other value, the sound handle
int CRM32Pro_ISoundFX::SoundLoad ( char *  fileDPF,
char *  namesnd 
)

Load WAV,VOC,AIFF and OGG sound from DPF(using a filename) file.

Parameters:
fileDPF DPF file that contains the sound
namesnd sound name
Returns:
-1 Failed
any other value, the sound handle
int CRM32Pro_ISoundFX::SoundLoad ( const char *  f  ) 

Load WAV,VOC,AIFF and OGG sound from external file.

Parameters:
f file that contains the sound
Returns:
-1 Failed
any other value, the sound handle
Examples:
Example01_BasicCode.cpp, and SpacePong.cpp.
void CRM32Pro_ISoundFX::SoundPlay ( int  ch,
int  hndSound,
int  loops 
)

Play a sound.

Parameters:
ch the channel to use to play the sound
hndSound sound handle with the sound
loops number of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop).
Examples:
Example01_BasicCode.cpp, and SpacePong.cpp.
void CRM32Pro_ISoundFX::SoundVolume ( int  hndSound,
int  vol 
)

Sound volume control.

Parameters:
hndSound sound handle to adjust the volume
vol volume from 0 to 255

The documentation for this class was generated from the following files:

Generated on Mon Dec 21 17:04:40 2009 for CRM32Pro SDK v5.00 by  doxygen 1.6.1