WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. Sound
Mission NodeSDK 6.1C++API Reference

Sound

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 unkno...

API / SDK 6.1 / C++ / API Reference

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

Sound
CPP
1i32_t SND_getAssetId(const char* soundName);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Sound
CPP
1i32_t SND_cacheSounds(soundID_t* soundIDs, u32_t count);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Sound
CPP
1i32_t SND_play(soundID_t soundID, u32_t volume);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SND_stop

Summary

Stops the playback.

Synopsis

Sound
CPP
1i32_t SND_stop();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SND_isPlaying

Summary

Returns current playback status.

Synopsis

Sound
CPP
1i32_t SND_isPlaying();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

SND_getAssetsCount

Summary

Returns a number of sound assets currently used by the application.

Synopsis

Sound
CPP
1i32_t SND_getAssetsCount()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Jump Grid

On This Page

SND getAssetIdSND cacheSoundsSND playSND stopSND isPlayingSND getAssetsCount
Context Rail

Related nodes

Global Defines
API / SDK 6.1 / C++ / API Reference
Data Structures
API / SDK 6.1 / C++ / API Reference
Enumerated Types
API / SDK 6.1 / C++ / API Reference
Application
API / SDK 6.1 / C++ / API Reference
Previous Node
Topology
API / SDK 6.1 / C++ / API Reference
Next Node
Motion Sensors
API / SDK 6.1 / C++ / API Reference