/Cinder-poSoundManager

Potion's basic sound management block for Cinder.

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

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);