OpenAL Source.
More...
#include <OpenAL.hh>
|
| OpenALSource () |
| Constructor.
|
|
virtual | ~OpenALSource () |
| Destructor.
|
|
std::vector< std::string > | CollisionNames () const |
| Get a vector of all the collision names.
|
|
void | FillBufferFromFile (const std::string &_audioFile) |
| Fill the OpenAL audio buffer with data from a sound file.
|
|
bool | FillBufferFromPCM (uint8_t *_pcmData, unsigned int _dataCount, int _sampleRate) |
| Fill the OpenAL audio buffer from PCM data.
|
|
bool | HasCollisionName (const std::string &_name) const |
| Get whether the source has a collision name set.
|
|
bool | IsPlaying () |
| Is the audio playing.
|
|
bool | Load (sdf::ElementPtr _sdf) |
| Load the source from sdf.
|
|
bool | OnContact () const |
| Return true if the audio source is played on contact with another object.
|
|
void | Pause () |
| Pause a sound.
|
|
void | Play () |
| Play a sound.
|
|
void | Rewind () |
| Rewind the sound to the beginning.
|
|
bool | SetGain (float _g) |
| Set the pitch of the source.
|
|
bool | SetLoop (bool _state) |
| Set whether the source loops the audio.
|
|
bool | SetPitch (float _p) |
| Set the pitch of the source.
|
|
bool | SetPose (const ignition::math::Pose3d &_pose) |
| Set the position of the source.
|
|
bool | SetVelocity (const ignition::math::Vector3d &_vel) |
| Set the velocity of the source.
|
|
void | Stop () |
| Stop a sound.
|
|
OpenAL Source.
This can be thought of as a speaker.
◆ OpenALSource()
◆ ~OpenALSource()
◆ CollisionNames()
std::vector< std::string > CollisionNames |
( |
| ) |
const |
Get a vector of all the collision names.
- Returns
- All the collision names used to trigger audio playback on contact.
◆ FillBufferFromFile()
void FillBufferFromFile |
( |
const std::string & | _audioFile | ) |
|
Fill the OpenAL audio buffer with data from a sound file.
- Parameters
-
[in] | _audioFile | Name and an audio file. |
◆ FillBufferFromPCM()
bool FillBufferFromPCM |
( |
uint8_t * | _pcmData, |
|
|
unsigned int | _dataCount, |
|
|
int | _sampleRate ) |
Fill the OpenAL audio buffer from PCM data.
- Parameters
-
[in] | _pcmData | Pointer to the PCM audio data. |
[in] | _dataCount | Size of the PCM data. |
[in] | _sampleRate | Sample rate for the PCM data. |
- Returns
- True on success.
◆ HasCollisionName()
bool HasCollisionName |
( |
const std::string & | _name | ) |
const |
Get whether the source has a collision name set.
- Parameters
-
[in] | _name | Name of a collision to check for. |
- Returns
- True if the collision name was found.
◆ IsPlaying()
◆ Load()
bool Load |
( |
sdf::ElementPtr | _sdf | ) |
|
Load the source from sdf.
- Parameters
-
[in] | _sdf | SDF element parameters for an audio_source. |
- Returns
- True on success.
◆ OnContact()
Return true if the audio source is played on contact with another object.
Contact is determine based on a set of collision objects.
- Returns
- True if audio is played on contact.
- See also
- AddCollision()
◆ Pause()
◆ Play()
◆ Rewind()
Rewind the sound to the beginning.
◆ SetGain()
Set the pitch of the source.
- Parameters
-
- Returns
- True on success.
◆ SetLoop()
bool SetLoop |
( |
bool | _state | ) |
|
Set whether the source loops the audio.
- Parameters
-
[in] | _state | True to cause playback to loop. |
- Returns
- True on success.
◆ SetPitch()
bool SetPitch |
( |
float | _p | ) |
|
Set the pitch of the source.
- Parameters
-
- Returns
- True on success.
◆ SetPose()
bool SetPose |
( |
const ignition::math::Pose3d & | _pose | ) |
|
Set the position of the source.
- Parameters
-
[in] | _pose | New pose of the source. |
- Returns
- True on success.
◆ SetVelocity()
bool SetVelocity |
( |
const ignition::math::Vector3d & | _vel | ) |
|
Set the velocity of the source.
- Parameters
-
[in] | _vel | New velocity of the source. |
- Returns
- True on success.
◆ Stop()
The documentation for this class was generated from the following file: