C4 Engine
C4 Engine API Documentation

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::LoadSound Loads a sound resource into a Sound object.
Sound::StreamSound 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::PlaySound Plays a sound.
Sound::StopSound Stops a sound.
Sound::DelaySound Plays a sound after a given delay time.
Sound::PauseSound Pauses a sound.
Sound::ResumeSound Resumes a sound.
Sound::Release Releases a sound.
 
Sound::VaryVolume Varies the volume of a sound over a specific time period.
Sound::VaryFrequency Varies the frequency of a sound over a specific time period.
Sound::VolumeVarying Returns a boolean value indicating whether a sound's volume is being varied.
Sound::FrequencyVarying Returns a boolean value indicating whether a sound's frequency is being varied.
Sound::SetVolumeVariationCompletionCallback Installs a completion callback function that is invoked when a volume variation has completed.
Sound::SetFrequencyVariationCompletionCallback Installs a completion callback function that is invoked when a frequency variation has completed.
 
Sound::GetSoundDuration 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::SetLoopCallback Installs a callback function that is invoked when a sound loops.
 
Sound::GetSoundGroup Returns a sound's group.
Sound::SetSoundGroup Sets a sound's group.
 
Sound::GetSoundTransformable Returns a sound's 3D transform.
Sound::SetSoundTransformable Sets a sound's 3D transform.
Sound::GetSoundVelocity Returns a sound's 3D velocity.
Sound::SetSoundVelocity 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::LoadSound function should be called to load a sound resource or the Sound::StreamSound 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 callback function 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

Wiki Articles

Sound