Sound
SND_getAssetId
Summary
Get a sound ID by the filename.
Description
Usually an application uses sound IDs to start playback. But sometimes IDs are unknown, e.g. in common libraries, or they change rapidly during development. This interface can be used to get an ID of the sound by its filename in runtime. Recommended way is use this function in initialization code.
Inputs
- soundName - sound filename for which ID is requested
Return value
The ID of sound with a given filename or -1 in case of error.
Synopsis
SND_cacheSounds
Summary
Force the platform to cache application sounds.
Description
The platform automatically reads and caches sounds from flash when the application plays a sound. Flash operations are synchronous and may cause delays especially when reading large portions of data. To prevent the application from lags it is possible to cache sound data in advance. However if application requests to play a non-cached sound and there is not enough memory then oldest accessed sounds will be removed from cache. Also there is a limit of 256 for a total number of cached sounds.
Inputs
- soundIDs - array with IDs of sounds to cache
- count - size of soundIDs array
Return value
Number of cached sounds or negative value if an error happened. Error codes:
- -1 : invalid function arguments count
- -2 : invalid soundList array
Synopsis
SND_play
Summary
Play sound by ID.
Description
Play any sound by its ID. Platform does not support audio mixing, so previously playing sound will be stopped if it has not yet finished. Supported audio formats:
- WAV
- MP3
- MIDI
Inputs
- soundID - an ID of sound to play
- volume - volume of sound in percents to play, range 0..100
Synopsis
SND_stop
Summary
Stops the playback.
Synopsis
SND_isPlaying
Summary
Returns current playback status.
Synopsis
SND_getAssetsCount
Summary
Returns a number of sound assets currently used by the application.
Synopsis