This class implements an audio source.
More...
#include <CAudioSource.h>
This class implements an audio source. An audio source is a sound generator that is placed inside the world at a specific location. A sound generator plays sounds that are stored by audio buffers.
chai3d::cAudioSource::cAudioSource |
( |
| ) |
|
chai3d::cAudioSource::~cAudioSource |
( |
| ) |
|
|
virtual |
bool chai3d::cAudioSource::setAudioBuffer |
( |
cAudioBuffer * |
a_audioBuffer | ) |
|
This method assigns an audio buffer to this audio source.
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::play |
( |
| ) |
|
This method begins playing the audio source.
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::isPlaying |
( |
| ) |
|
This method checks if the audio source is currently playing.
- Returns
- true if audio source is playing, false otherwise.
bool chai3d::cAudioSource::pause |
( |
| ) |
|
This method pauses the audio source from playing.
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::stop |
( |
| ) |
|
This method stops the audio source from playing.
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::rewind |
( |
| ) |
|
This method rewinds the audio source.
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::setPosTime |
( |
const float |
a_time | ) |
|
This method sets the playing position of the audio source to a desired value a_time
passed as argument and defined in seconds.
- Parameters
-
a_time | Playing position defined in seconds. |
- Returns
- true if operation succeeds, false otherwise.
ALfloat chai3d::cAudioSource::getPosTime |
( |
| ) |
|
This method returns the current playing position of the audio source.
- Returns
- Current playing position time in seconds.
short chai3d::cAudioSource::getSampleLeft |
( |
double |
a_time | ) |
|
This method returns the left sample at a given time.
- Parameters
-
- Returns
- Current playing position time in seconds.
short chai3d::cAudioSource::getSampleRight |
( |
double |
a_time | ) |
|
This method returns the right sample at a given time.
- Parameters
-
- Returns
- Current playing position time in seconds.
bool chai3d::cAudioSource::setPitch |
( |
const float |
a_pitch | ) |
|
This method sets the audio pitch.
- Parameters
-
a_pitch | Pitch value. This value must be positive. |
- Returns
- true if operation succeeds, false otherwise.
float chai3d::cAudioSource::getPitch |
( |
| ) |
|
|
inline |
bool chai3d::cAudioSource::setGain |
( |
const float |
a_gain | ) |
|
This method sets the audio gain.
- Parameters
-
a_gain | Gain value. The value must be positive. |
- Returns
- true if operation succeeds, false otherwise.
float chai3d::cAudioSource::getGain |
( |
| ) |
|
|
inline |
bool chai3d::cAudioSource::setSourcePos |
( |
const cVector3d |
a_sourcePos | ) |
|
This method sets the position of the audio source in world coordinates.
- Parameters
-
a_sourcePos | Position of the audio source in world coordinates. |
- Returns
- true if operation succeeds, false otherwise.
cVector3d chai3d::cAudioSource::getSourcePos |
( |
| ) |
|
|
inline |
bool chai3d::cAudioSource::setSourceVel |
( |
const cVector3d |
a_sourceVel | ) |
|
This method sets the velocity of the audio source in world coordinates.
- Parameters
-
a_sourceVel | Velocity of the audio source in world coordinates. |
- Returns
- true if operation succeeds, false otherwise.
cVector3d chai3d::cAudioSource::getSourceVel |
( |
| ) |
|
|
inline |
bool chai3d::cAudioSource::setLoop |
( |
const bool |
a_loop | ) |
|
This method enables or disables loop playing. Set argument a_loop
to true to enable loop playing, false otherwise.
- Parameters
-
- Returns
- true if operation succeeds, false otherwise.
bool chai3d::cAudioSource::getLoop |
( |
| ) |
|
|
inline |
bool chai3d::cAudioSource::checkError |
( |
| ) |
|
|
protected |
This method checks for any OpenAL errors.
- Returns
- true if no errors occurred, false otherwise.
unsigned int chai3d::cAudioSource::m_source |
|
protected |
float chai3d::cAudioSource::m_pitch |
|
protected |
float chai3d::cAudioSource::m_gain |
|
protected |
bool chai3d::cAudioSource::m_loop |
|
protected |
The documentation for this class was generated from the following files: