AudioSource¶
Inherited: None
Description¶
The AudioSource class provides methods to manage the playback of audio clips. It allows users to set audio clips, control playback, and adjust parameters like auto-play and looping.
Public Methods¶
Static Methods¶
None
Methods Description¶
bool AudioSource::autoPlay () const
Returns true if auto-play is enabled; otherwise, returns false.
See also setAutoPlay().
AudioClip * AudioSource::clip () const
Returns the audio clip associated with the audio source.
See also setClip().
bool AudioSource::loop () const
Returns true if looping is enabled; otherwise, returns false.
See also setLoop().
void AudioSource::play ()
Plays the audio clip in the specific position in 3D space.
void AudioSource::setAutoPlay (bool play)
Sets the auto play state.
See also autoPlay().
void AudioSource::setClip (AudioClip * clip)
Sets the audio clip for the audio source.
See also clip().
void AudioSource::setLoop (bool loop)
Sets the loop state.
See also loop().
void AudioSource::stop ()
Stops the audio source.