AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aire::AudioSource Class Reference

AudioSource class to play sound effects. More...

#include <audioSource.h>

Public Member Functions

 AudioSource (const std::string &soundFile)
 Constructs an AudioSource object with the specified sound file.
 
 AudioSource (const std::string &soundFile, float x, float y, float z)
 Constructs an AudioSource object with the specified sound file and position.
 
 AudioSource (const std::string &soundFile, const glm::vec3 &pos)
 Constructs an AudioSource object with the specified sound file and position.
 
void release ()
 Releases resources associated with the AudioSource.
 
void play ()
 Plays the audio.
 
void pause ()
 Pauses the audio.
 
void stop ()
 Stops the audio.
 
AudioSourceloop (bool shouldLoop)
 Sets whether the audio should loop.
 
AudioSourcespatial (bool isSpatial)
 Sets whether the audio should be spatial.
 
AudioSourcesetPosition (float x, float y, float z)
 Sets the position of the AudioSource.
 
AudioSourcesetPosition (const glm::vec3 &pos)
 Sets the position of the AudioSource.
 
AudioSourcesetValue (float value)
 Set the value of the AudioSource.
 
AudioSourcesetLinearDistanceModel ()
 Set the distance model to linear.
 
AudioSourcesetExponentialDistanceModel (float refDistance, float rollFactor)
 Set the distance model to exponential.
 
glm::vec3 getPosition () const
 Gets the position of the AudioSource.
 

Detailed Description

AudioSource class to play sound effects.

Constructor & Destructor Documentation

◆ AudioSource() [1/3]

AudioSource::AudioSource ( const std::string & soundFile)

Constructs an AudioSource object with the specified sound file.

Parameters
soundFileThe path to the sound file.

◆ AudioSource() [2/3]

AudioSource::AudioSource ( const std::string & soundFile,
float x,
float y,
float z )

Constructs an AudioSource object with the specified sound file and position.

Parameters
soundFileThe path to the sound file.
xThe x-coordinate of the position.
yThe y-coordinate of the position.
zThe z-coordinate of the position.
Here is the call graph for this function:

◆ AudioSource() [3/3]

Aire::AudioSource::AudioSource ( const std::string & soundFile,
const glm::vec3 & pos )

Constructs an AudioSource object with the specified sound file and position.

Parameters
soundFileThe path to the sound file.
posThe position vector.
Here is the call graph for this function:

Member Function Documentation

◆ getPosition()

glm::vec3 Aire::AudioSource::getPosition ( ) const

Gets the position of the AudioSource.

Returns
The position vector.

◆ loop()

AudioSource * AudioSource::loop ( bool shouldLoop)

Sets whether the audio should loop.

Parameters
shouldLoopTrue if the audio should loop, false otherwise.
Returns
Pointer to the current AudioSource object.
Here is the caller graph for this function:

◆ setExponentialDistanceModel()

AudioSource * Aire::AudioSource::setExponentialDistanceModel ( float refDistance,
float rollFactor )

Set the distance model to exponential.

Parameters
refDistance
rollFactor
Returns
Pointer to the current AudioSource object.
Here is the caller graph for this function:

◆ setLinearDistanceModel()

AudioSource * Aire::AudioSource::setLinearDistanceModel ( )

Set the distance model to linear.

Returns
Pointer to the current AudioSource object.

◆ setPosition() [1/2]

AudioSource * Aire::AudioSource::setPosition ( const glm::vec3 & pos)

Sets the position of the AudioSource.

Parameters
posThe position vector.
Returns
Pointer to the current AudioSource object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPosition() [2/2]

AudioSource * AudioSource::setPosition ( float x,
float y,
float z )

Sets the position of the AudioSource.

Parameters
xThe x-coordinate of the position.
yThe y-coordinate of the position.
zThe z-coordinate of the position.
Returns
Pointer to the current AudioSource object.
Here is the caller graph for this function:

◆ setValue()

AudioSource * Aire::AudioSource::setValue ( float value)

Set the value of the AudioSource.

Parameters
value
Returns
Pointer to the current AudioSource object.
Here is the caller graph for this function:

◆ spatial()

AudioSource * Aire::AudioSource::spatial ( bool isSpatial)

Sets whether the audio should be spatial.

Parameters
isSpatialTrue if the audio should be spatial, false otherwise.
Returns
Pointer to the current AudioSource object.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: