Potion's basic sound management block for Cinder. It is particularly useful for playing multiple sounds at once without worrying about volume. The volume for all currently playing sounds are averaged to remain under a MAX_VOLUME
threshold internally. Cinder-poSoundManager is released under the BSD New License.
The block consists of a single class, SoundManager, that provides basic sound playback control.
- Play, loop a track created with a datasource or audio buffer
- Stop a track, all sounds, or tracks in a group
- Track pan and gain
- Signal when a sound has finished playing
- Averaged volume when playing multiple tracks
- MultipleSounds: plays a looped sound on mouse down and other sounds on key press.
Play a sound:
DataSourceRef source = loadAsset("tune.wav");
po::SoundManager::get()->play(source);
Stop a looped sound:
DataSourceRef source = loadAsset("tune.wav");
unsigned int mTrackID = po::SoundManager::get()->play(source, 0, true); // looped
po::SoundManager::get()->stop(mTrackID);