Skip to content
Potion's basic sound management block for Cinder.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
samples/MultipleSounds
src/poSoundManager
.gitignore
LICENSE
README.md
cinderblock.png
cinderblock.xml

README.md

Cinder-poSoundManager

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.

Features

  • 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

Samples

  • MultipleSounds: plays a looped sound on mouse down and other sounds on key press.

Getting Started

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);
You can’t perform that action at this time.