C4 Engine Terathon Software C4 Engine API Documentation

• Sound Manager

API Links
Developer Links

class Sound

Defined in:  C4Sound.h
Encapsulates functionality for a sound.
Definition

class Sound : public Completable<Sound>, public ListElement<Sound>, public Memory<Sound>

Member Functions
Sound::Load Loads a sound resource into a Sound object.
Sound::Stream Establishes a streaming source for a Sound object.
 
Sound::GetSoundFlags Returns the sound flags.
Sound::SetSoundFlags Sets the sound flags.
Sound::GetSoundState Returns a sound's current state.
 
Sound::Play Plays a sound.
Sound::Stop Stops a sound.
Sound::Delay Plays a sound after a given delay time.
Sound::Pause Pauses a sound.
Sound::Resume Resumes a sound.
Sound::Release Releases a sound.
 
Sound::Fade Fades a sound to a specific volume.
Sound::Fading Returns a boolean value indicating whether a sound is fading.
Sound::SetFadeProc Installs a callback procedure which is invoked when a fade has ended for a sound.
 
Sound::GetDuration Returns the duration of a sound.
Sound::GetSoundProperty Returns a sound property.
Sound::SetSoundProperty Sets a sound property.
Sound::GetLoopCount Returns the number of times that a sound will loop.
Sound::SetLoopCount Sets the number of times that a sound will loop.
Sound::GetLoopIndex Returns the index of the resource in a streaming sound's play list which will be played when the sound loops.
Sound::SetLoopIndex Sets the index of the resource in a streaming sound's play list which will be played when the sound loops.
Sound::SetLoopProc Installs a callback procedure which is invoked when a sound loops.
 
Sound::GetSoundGroup Returns a sound's group.
Sound::SetSoundGroup Sets a sound's group.
 
Sound::GetTransformable Returns a sound's 3D transform.
Sound::SetTransformable Sets a sound's 3D transform.
Sound::GetVelocity Returns a sound's 3D velocity.
Sound::SetVelocity Sets a sound's 3D velocity.
Constructor

Sound();

Description
The Sound class represents an audio source within the Sound Manager. The constructor simply initializes the internal state of the sound to default values and does nothing else. After a new Sound object is constructed, either the Sound::Load function should be called to load a sound resource or the Sound::Stream function should be called to establish a streaming source for the sound.

Sound objects cannot be explicitly destroyed by using the delete operator. Sound objects should be released by calling the Sound::Release function.
NOTE. For sound effects placed in a 3D world, the high-level functionality provided by the Source node class is what an application should ordinarily use. The World Manager performs additional processing on Source nodes that is not available to sounds created with the low-level Sound class. However, the Sound class should be used for music and ambient sound effects that are not placed in 3D space.
Base Classes
Completable<Sound> The completion procedure is called when the sound finishes playing.
ListElement<Sound> Used internally by the Sound Manager.
Memory<Sound> Sound objects are allocated in a dedicated heap.
See Also
Source