SparrowSound is for sound output. Most calls and types are just renames of libSDL_mixer functions with error handling. For more details (especially about what is not wrapped here) have a look at http://www.libsdl.org
| sparrowSound | SparrowSound is for sound output. |
| SP_VOLUME_MAX | The maximal volume of a channel or chunk/spSound. |
| spSound | This type ist just Mix_Chunk from SDL Mixer renamed for better usage (I don’t like the SDL name). |
| spSoundInit | This inits spSound. |
| spSoundSetChannels | Sets the maximum count of channels. |
| spSoundQuit | This has to be called at the end of the program. |
| spSoundPauseAll | Pauses or resumes all music and sounds. |
| Background music functions | These functions are for the background music. |
| spSoundSetMusic | Sets the background music file. |
| spSoundPlayMusic | Plays the loaded music from spSoundSetMusic with optional fade in and repeating. |
| spSoundStopMusic | Stops playing the loaded music with optional fade out. |
| spSoundPauseMusic | Pauses or resumes the music. |
| spSoundSetMusicVolume | Sets the volume of the background music. |
| spSoundGetMusicVolume | Returns the volume of the background music. |
| Sound sample functions | These functions are for the sound samples. |
| spSoundLoad | Loads a spSound from a file. |
| spSoundPlay | Plays a spSound sound. |
| spSoundStop | Stops a channel. |
| spSoundPause | Pauses or resumes a channel. |
| spSoundDelete | Deletes a sound. |
| spSoundSetVolume | Sets the volume of all sound. |
| spSoundGetVolume | Returns the volume of all sounds. |
PREFIX int spSoundSetMusic( char * filename )
Sets the background music file. Every function for background music uses this function. It’s like spBindTexture for music. ^^’ To start the music use spSoundPlayMusic afterwards.
| filename | the music file to be used. Many formats are supported depending on the system. ogg, mp3, flac, wav should always be fine, but I already had system without mpe-support. In doubt use ogg or flac. |
| int | 1 at success, 0 at failure |
PREFIX int spSoundPlayMusic( int fadeIn, int loops )
Plays the loaded music from spSoundSetMusic with optional fade in and repeating.
| fadeIn | if greater 0, the duration of the fade in |
| loops | the amount of times the background music will be played. -1 means “infinite” times and 0 means just once (0 repeats ;)) |
| int | 1 at success, 0 at failure |
PREFIX spSound* spSoundLoad( char * filename )
Loads a spSound from a file. The loaded file is not played automaticly, use spSoundPlay for this.
| filename | the file to be loaded. Many formats are possible like wav, ogg, mp3 or flac. But some systems don’t support everything so it is a good idea to stay with ogg and flac. |
PREFIX int spSoundPlay( spSound * sound, int channel, int loops, int fadeIn, int maxTime )
Plays a spSound sound.
| sound | the sound to be played |
| channel | if you want to play on a specific channel, use this parameter, if you don’t care (what you will most of the time) use -1 |
| loops | the amount of times the sound will be played. -1 means “infinite” times and 0 means just once (0 repeats ;)) |
| fadeIn | if greater 0, the duration of the fade in |
| maxTime | the maximal time of playing the sound even with “infinite” loops. -1 means no maximal duration |
| int | the channel, in which the sound is played |
PREFIX void spSoundStop( int soundChannel, int fadeOut )
Stops a channel. You have to stop channels instead of spSounds, because one sound can be played multiple times on multiple channels.
| soundChannel | the channel to be stopped. -1 stops every channel |
| fadeOut | if greater 0 this is the duration of a fade out |
PREFIX void spSoundPause( int pause, int channel )
Pauses or resumes a channel.
| pause | use 1 for pause and 0 for resume |
| channel | the channel to be paused or resumed. -1 means every channel is pause or resumed. To pause or resume every channel and the background music use spSoundPauseAll |
This inits spSound.
PREFIX int spSoundInit( void )
Sets the maximum count of channels.
PREFIX void spSoundSetChannels( int channels )
This has to be called at the end of the program.
PREFIX void spSoundQuit( void )
Pauses or resumes all music and sounds.
PREFIX void spSoundPauseAll( int pause )
Sets the background music file.
PREFIX int spSoundSetMusic( char * filename )
Plays the loaded music from spSoundSetMusic with optional fade in and repeating.
PREFIX int spSoundPlayMusic( int fadeIn, int loops )
Stops playing the loaded music with optional fade out.
PREFIX int spSoundStopMusic( int fadeOut )
Pauses or resumes the music.
PREFIX void spSoundPauseMusic( int pause )
Sets the volume of the background music.
PREFIX void spSoundSetMusicVolume( int volume )
Returns the volume of the background music.
PREFIX int spSoundGetMusicVolume( void )
Loads a spSound from a file.
PREFIX spSound* spSoundLoad( char * filename )
Plays a spSound sound.
PREFIX int spSoundPlay( spSound * sound, int channel, int loops, int fadeIn, int maxTime )
Stops a channel.
PREFIX void spSoundStop( int soundChannel, int fadeOut )
Pauses or resumes a channel.
PREFIX void spSoundPause( int pause, int channel )
Deletes a sound.
PREFIX void spSoundDelete( spSound * sound )
Sets the volume of all sound.
PREFIX void spSoundSetVolume( int volume )
Returns the volume of all sounds.
PREFIX int spSoundGetVolume( void )
This texture will be used for all following draw operations with textures
PREFIX void spBindTexture( SDL_Surface * texture )