| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SoundManager Class Reference#include <SoundManager.h>
Detailed DescriptionProvides sound effects and caching services, as well as mixing buffers for the SoundPlay process.Provides easy methods for playing back sounds, either from files on the memory stick, or from dynamically generated buffers. You can chain playback commands so that when one sound finishes, another picks up automatically. This might be handy if, say, someone wants to write an MP3 player ;) The sounds would be too large to load into memory all at once, but you could load a block at a time and chain them so it seamlessly moves from one to the other. You can also preload sounds (loadFile()) before playing them (play() / playFile()) so there's no delay between requesting a sound and having it start playing while it is loaded from disk/memory stick. Just be sure to release the file (releaseFile()) again when you're done with it ;) All functions will attempt to lock the SoundManager. Remember, this is running in a shared memory region, accessible by the SoundPlay process and both the Main and Motion processes (so MotionCommands can play sounds!) One could be tempted to draw parallels to the MotionManager, and envision a system with SoundCommands that are handed over and can dynamically compute sound buffers as needed. If you have the time and inclination, the job's all yours... (Midi players, speech synthesizer, ...?)
Definition at line 58 of file SoundManager.h.
Member Enumeration DocumentationUsed to set the mode for mixing multiple sound channels. Feel free to add a higher quality mixer if you're an audiophile - I'm pretty new to sound processing
Definition at line 87 of file SoundManager.h. indicates how to handle channel overflow (trying to play more sounds than maximum number of mixing channels). See queue_mode
Definition at line 94 of file SoundManager.h.
Member Function Documentationallows automatic queuing of sounds - good for dynamic sound sources! if you chain more than once to the same base, the new buffers are appended to the end of the chain - the new buffer doesn't replace the current chain
allows automatic queuing of sounds - good for dynamic sound sources! if you chain more than once to the same base, the new buffers are appended to the end of the chain - the new buffer doesn't replace the current chain
Definition at line 291 of file SoundManager.cc. Referenced by ChainBuffer(), and SpeakerServer::QueueFrame().
allows automatic queuing of sounds - good for dynamic sound sources! if you chain more than once to the same base, the new buffers are appended to the end of the chain - the new buffer doesn't replace the current chain
Definition at line 271 of file SoundManager.cc. Referenced by ChainFile().
Copies the sound data to the specified memory buffer, ready to be passed to the system.
Definition at line 512 of file SoundManager.cc.
Copies the sound data to the OPENR buffer, ready to be passed to the system, only called by SoundPlay.
Definition at line 499 of file SoundManager.cc.
Gives the time until the sound finishes, in milliseconds. Subtract 32 to get guarranteed valid time for this ID.
You should be passing the beginning of a chain to get proper results... Definition at line 387 of file SoundManager.cc. Referenced by GetRemainTime(), and SpeakerServer::QueueFrame().
loads raw samples from a buffer (assumes matches Config::sound_config settings)
The sound data will be cached until release() is called a matching number of times. Definition at line 100 of file SoundManager.cc. Referenced by chainBuffer(), LoadBuffer(), loadFile(), and playBuffer().
loads a wav file (if it matches Config::sound_config settings - can't do resampling yet) Since the SoundManager does the loading, if the same file is being played more than once, only once copy is stored in memory
Definition at line 57 of file SoundManager.cc. Referenced by chainFile(), Controller::DoStart(), LoadFile(), and playFile().
Mixes the channel into the buffer additively. If mode is Quality, then the size of the buffer should be double the normal size. Definition at line 429 of file SoundManager.cc. Referenced by CopyTo().
loads raw samples from a buffer (assumes buffer matches Config::sound_config settings) The sound data will be released after done playing Definition at line 213 of file SoundManager.cc. Referenced by chainBuffer(), PlayBuffer(), and SpeakerServer::QueueFrame().
play a wav file (if it matches Config::sound_config settings - can't do resampling yet) Will do a call to loadFile() first, and then automatically release the sound again when complete.
Definition at line 200 of file SoundManager.cc. Referenced by chainFile(), ControlBase::doCancel(), ControlBase::doNextItem(), ControlBase::doPrevItem(), ControlBase::doReadStdIn(), WaypointWalkControl::WaypointEditControl::doSelect(), WaypointWalkControl::doSelect(), WalkCalibration::doSelect(), SensorObserverControl::doSelect(), EventLogger::doSelect(), ControlBase::doSelect(), SoundNode::DoStart(), WalkCalibration::err(), Transition::fire(), RandomTrans::fire(), PlayFile(), WalkCalibration::processEvent(), AutoGetupBehavior::processEvent(), TorqueCalibrate::record(), WalkControllerBehavior::runCommand(), UPennWalkControllerBehavior::runCommand(), RunSequenceControl< SequenceSize >::selectedFile(), PlaySoundControl::selectedFile(), LoadPostureControl::selectedFile(), ControlBase::setHilights(), EmergencyStopMC::setStopped(), WalkCalibration::takeInput(), TorqueCalibrate::TakeMeasurementControl::takeInput(), and TorqueCalibrate::TakeMeasurementControl::transition().
Member Data Documentation
A serial number, incremented for each sound which is created. This is used to verify that a sound message from a process refers to a current sound. If you imaging a pathological process, which rapidly creates and releases sounds, it would run through the sndlist ids, possibly before the sound process can process the incoming buffers. So this is used to ensure that a given message refers to the current sound, and not one that was already released and then reassigned. Definition at line 307 of file SoundManager.h. Referenced by getNextKey(), initRegion(), and loadBuffer().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Fri May 11 20:08:49 2007 by Doxygen 1.4.7 |