CRM32Pro SDK
v5.22
|
ISoundFX. More...
ISoundFX.
Sound,music and FX effects interface.
Public Member Functions | |
int | AllocateChannels (int nch) |
Dynamically change the number of channels managed by the mixer. More... | |
int | ChannelFadeIn (int ch, int hndSound, int loops, int ms) |
Channel fade in. More... | |
int | ChannelFadeOut (int ch, int ms) |
Channel fade out. More... | |
int | ChannelGetVolume (int ch) |
Channel get volume. More... | |
int | ChannelIsPaused (int ch) |
Check a mixing channel pause status. More... | |
void | ChannelPause (int ch) |
Channel pause. More... | |
void | ChannelResume (int ch) |
Channel resume. More... | |
void | ChannelStop (int ch) |
Channel stop. More... | |
void | ChannelVolume (int ch, int vol) |
Channel volume control. More... | |
unsigned char | Export (char *fileDPF, char *namesnd, char m, char *s=NULL) |
Export audio from a DPF(using a filename) to a filename. More... | |
unsigned char | Export (int idDPF, char *namesnd, char m, char *s=NULL) |
Export audio from a DPF(using an idDPF) to a filename. More... | |
unsigned char | Init (int frequency, unsigned short format, int channels, int chunksize) |
Initialize sound system. More... | |
unsigned char | Init () |
Try to initialize sound system according to CRM32Pro.Config. More... | |
int | Initialized () |
Was sound system activated? More... | |
int | IsPlaying (void) |
Check if music is playing. More... | |
int | IsPlaying (int ch) |
Check if a mixing channel is playing. More... | |
int | MusicFadeIn (int hndMusic, int loops, int ms) |
Music fade in. More... | |
int | MusicFadeOut (int ms) |
Music fade out. More... | |
void | MusicFree (int hndMusic) |
Free a music. More... | |
int | MusicGetVolume () |
Music get volume. More... | |
int | MusicImport (char *fileDPF, char *namemus, char *filemus) |
Import a XM,IT,MOD,S3M or OGG music in to a DPF file(using filename) More... | |
int | MusicImport (int idDPF, char *namemus, char *filemus) |
Import a XM,IT,MOD,S3M or OGG music in to a DPF file(using idDPF) More... | |
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. More... | |
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. More... | |
int | MusicIsPaused (void) |
Check the music pause status. More... | |
int | MusicLoad (const char *f) |
Load a XM,IT,S3M,MOD and OGG music from an external file. More... | |
int | MusicLoad (char *fileDPF, char *musname) |
Load a XM,IT,S3M,MOD and OGG music from a DPF file(using a filename) More... | |
int | MusicLoad (int idDPF, char *musname) |
Load a XM,IT,S3M,MOD and OGG music from a DPF file(using an idDPF) More... | |
void | MusicPause (void) |
Pause music. | |
int | MusicPlay (int hndMusic, int loops) |
Play a music track (XM,S3M,MOD,IT or OGG) More... | |
void | MusicResume (void) |
Resume music from a paused or stopped status. | |
void | MusicRewind (void) |
Rewind the music to the start. | |
void | MusicStop (void) |
Music stop. | |
void | MusicVolume (int vol) |
Music volume control. More... | |
void | NoInit () |
Turn off sound output. | |
void | QuerySpec (int *freq, unsigned short *format, int *ch) |
Query sound system features. More... | |
void | Quit (void) |
Close sound system. | |
void | SoundFree (int hndSound) |
Free a sound. More... | |
int | SoundGetVolume (int hndSound) |
Sound get volume. More... | |
int | SoundImport (char *fileDPF, char *namesnd, char *filesnd) |
Import a WAV,VOC,AIFF and OGG sound in to DPF(using a filename) More... | |
int | SoundImport (int idDPF, char *namesnd, char *filesnd) |
Import a WAV,VOC,AIFF and OGG sound in to DPF(using an idDPF) More... | |
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. More... | |
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. More... | |
int | SoundLoad (const char *f) |
Load a WAV,VOC,AIFF and OGG sound from a filename. More... | |
int | SoundLoad (char *fileDPF, char *namesnd) |
Load a WAV,VOC,AIFF and OGG sound from a DPF(using a filename) More... | |
int | SoundLoad (int idDPF, char *namesnd) |
Load a WAV,VOC,AIFF and OGG sound from a DPF(using an idDPF) More... | |
void | SoundPlay (int ch, int hndSound, int loops) |
Play a sound. More... | |
void | SoundVolume (int hndSound, int vol) |
Sound volume control. More... | |
int CRM32Pro_ISoundFX::AllocateChannels | ( | int | nch | ) |
Dynamically change the number of channels managed by the mixer.
The default mixer has 8 simultaneous mixing channels. If decreasing the number of channels, the upper channels are stopped. This has nothing to do with audio output channels (mono,stereo, etc.)
nch | Number of mixing channels. A negative number will not do anything, it will tell you how many channels are currently allocated. |
int CRM32Pro_ISoundFX::ChannelFadeIn | ( | int | ch, |
int | hndSound, | ||
int | loops, | ||
int | ms | ||
) |
Channel fade in.
The effect is performed on the background (this method does not delay the execution)
ch | mixing channel to play on, or -1 for the first free unreserved mixing channel |
hndSound | sound handle to play |
loops | number of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop) |
ms | time in milliseconds |
int CRM32Pro_ISoundFX::ChannelFadeOut | ( | int | ch, |
int | ms | ||
) |
Channel fade out.
The effect is performed on the background (this method does not delay the execution)
ch | mixing channel to fade out or -1 to fade all mixing channels out |
ms | time in milliseconds |
int CRM32Pro_ISoundFX::ChannelGetVolume | ( | int | ch | ) |
Channel get volume.
ch | mixing channel. With -1, it will get the volume for all allocated mixing channels. |
int CRM32Pro_ISoundFX::ChannelIsPaused | ( | int | ch | ) |
Check a mixing channel pause status.
ch | mixing channel to test whether it is paused or not. With -1 it just return the number of paused mixing channels. |
void CRM32Pro_ISoundFX::ChannelPause | ( | int | ch | ) |
Channel pause.
ch | mixing channel to pause playing, or -1 for all allocated mixing channels |
void CRM32Pro_ISoundFX::ChannelResume | ( | int | ch | ) |
Channel resume.
ch | mixing channel to resume playing, or -1 for all allocated mixing channels |
void CRM32Pro_ISoundFX::ChannelStop | ( | int | ch | ) |
Channel stop.
ch | mixing channel to stop playing, or -1 for all allocated mixing channels. |
void CRM32Pro_ISoundFX::ChannelVolume | ( | int | ch, |
int | vol | ||
) |
Channel volume control.
ch | mixing channel. With -1, it will set the volume for all allocated mixing channels. |
vol | volume range 0 to 128. |
unsigned char CRM32Pro_ISoundFX::Export | ( | char * | fileDPF, |
char * | namesnd, | ||
char | m, | ||
char * | s = NULL |
||
) |
Export audio from a DPF(using a filename) to a filename.
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. |
unsigned char CRM32Pro_ISoundFX::Export | ( | int | idDPF, |
char * | namesnd, | ||
char | m, | ||
char * | s = NULL |
||
) |
Export audio from a DPF(using an idDPF) to a filename.
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. |
unsigned char CRM32Pro_ISoundFX::Init | ( | int | frequency, |
unsigned short | format, | ||
int | nchannels, | ||
int | chunksize | ||
) |
Initialize sound system.
frequency | frequency in Hz (11025,22050,44200) |
format | AUDIO_S8 to 8bits or AUDIO_S16 to 16bits sound resolution |
nchannels | number of audio output channels: 1 for mono, 2 for stereo, 4 for surround and 6 for surround with center and lfe. This has nothing to do with mixing channels. |
chunksize | buffer size, use 4096 for normal operation |
unsigned char CRM32Pro_ISoundFX::Init | ( | ) |
Try to initialize sound system according to CRM32Pro.Config.
int CRM32Pro_ISoundFX::Initialized | ( | ) |
Was sound system activated?
int CRM32Pro_ISoundFX::IsPlaying | ( | void | ) |
Check if music is playing.
int CRM32Pro_ISoundFX::IsPlaying | ( | int | ch | ) |
Check if a mixing channel is playing.
ch | mixing channel to check. -1 will return how many mixing channels are playing |
int CRM32Pro_ISoundFX::MusicFadeIn | ( | int | hndMusic, |
int | loops, | ||
int | ms | ||
) |
Music fade in.
The effect is performed on the background (this method does not delay the execution)
hndMusic | music handle to play |
loops | number of times to play through the music. 0 plays the music zero times and -1 plays it forever |
ms | time in milliseconds |
int CRM32Pro_ISoundFX::MusicFadeOut | ( | int | ms | ) |
Music fade out.
The effect is performed on the background (this method does not delay the execution)
ms | time in milliseconds |
void CRM32Pro_ISoundFX::MusicFree | ( | int | hndMusic | ) |
int CRM32Pro_ISoundFX::MusicGetVolume | ( | ) |
Music get volume.
int CRM32Pro_ISoundFX::MusicImport | ( | char * | fileDPF, |
char * | namemus, | ||
char * | filemus | ||
) |
Import a XM,IT,MOD,S3M or OGG music in to a DPF file(using filename)
fileDPF | DPF filename to store the music |
namemus | (to be stored with this name inside the DPF) |
filemus | music filename |
int CRM32Pro_ISoundFX::MusicImport | ( | int | idDPF, |
char * | namemus, | ||
char * | filemus | ||
) |
Import a XM,IT,MOD,S3M or OGG music in to a DPF file(using idDPF)
idDPF | ID of the opened DPF |
namemus | music name (to be stored with this name inside the DPF) |
filemus | music filename |
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.
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 |
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.
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 |
int CRM32Pro_ISoundFX::MusicIsPaused | ( | void | ) |
Check the music pause status.
int CRM32Pro_ISoundFX::MusicLoad | ( | const char * | fname | ) |
Load a XM,IT,S3M,MOD and OGG music from an external file.
fname | filename that contains the music |
int CRM32Pro_ISoundFX::MusicLoad | ( | char * | fileDPF, |
char * | namemus | ||
) |
Load a XM,IT,S3M,MOD and OGG music from a DPF file(using a filename)
fileDPF | DPF filename that contains the music |
namemus | music name |
int CRM32Pro_ISoundFX::MusicLoad | ( | int | idDPF, |
char * | namemus | ||
) |
Load a XM,IT,S3M,MOD and OGG music from a DPF file(using an idDPF)
idDPF | ID of the opened DPF |
namemus | music name |
int CRM32Pro_ISoundFX::MusicPlay | ( | int | hnd, |
int | loops | ||
) |
Play a music track (XM,S3M,MOD,IT or OGG)
hnd | music handle to play |
loops | number of times to play through the music. 0 plays the music zero times and -1 plays it forever |
void CRM32Pro_ISoundFX::MusicVolume | ( | int | vol | ) |
Music volume control.
vol | volume range 0 to 128. |
void CRM32Pro_ISoundFX::QuerySpec | ( | int * | freq, |
unsigned short * | format, | ||
int * | ch | ||
) |
Query sound system features.
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 an int where the number of audio output channels will be stored. Its value is 1 for mono, 2 for stereo, 4 for surround and 6 for surround with center and lfe |
void CRM32Pro_ISoundFX::SoundFree | ( | int | hndSound | ) |
Free a sound.
hndSound | sound handle to be deleted |
int CRM32Pro_ISoundFX::SoundGetVolume | ( | int | hndSound | ) |
Sound get volume.
hndSound | sound handle to get the volume |
int CRM32Pro_ISoundFX::SoundImport | ( | char * | fileDPF, |
char * | namesnd, | ||
char * | filesnd | ||
) |
Import a WAV,VOC,AIFF and OGG sound in to DPF(using a filename)
fileDPF | DPF filename |
namesnd | sound name (to be stored with this name inside the DPF) |
filesnd | filename with the sound |
int CRM32Pro_ISoundFX::SoundImport | ( | int | idDPF, |
char * | namesnd, | ||
char * | filesnd | ||
) |
Import a WAV,VOC,AIFF and OGG sound in to DPF(using an idDPF)
idDPF | ID of the opened DPF |
namesnd | sound name (to be stored with this name inside the DPF) |
filesnd | filename with the sound |
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.
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 |
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.
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 |
int CRM32Pro_ISoundFX::SoundLoad | ( | const char * | f | ) |
Load a WAV,VOC,AIFF and OGG sound from a filename.
f | file that contains the sound |
int CRM32Pro_ISoundFX::SoundLoad | ( | char * | fileDPF, |
char * | namesnd | ||
) |
Load a WAV,VOC,AIFF and OGG sound from a DPF(using a filename)
fileDPF | DPF file that contains the sound |
namesnd | sound name |
int CRM32Pro_ISoundFX::SoundLoad | ( | int | idDPF, |
char * | namesnd | ||
) |
Load a WAV,VOC,AIFF and OGG sound from a DPF(using an idDPF)
idDPF | ID of the opened DPF |
namesnd | sound name |
void CRM32Pro_ISoundFX::SoundPlay | ( | int | ch, |
int | hndSound, | ||
int | loops | ||
) |
Play a sound.
ch | mixing channel to play on, or -1 for the first free unreserved mixing channel |
hndSound | sound handle to play |
loops | number of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop) |
void CRM32Pro_ISoundFX::SoundVolume | ( | int | hndSound, |
int | vol | ||
) |
Sound volume control.
hndSound | sound handle to adjust the volume |
vol | volume range 0 to 128. |