17#ifndef _GAZEBO_UTIL_OPENAL_HH_
18#define _GAZEBO_UTIL_OPENAL_HH_
25#include <ignition/math/Vector3.hh>
26#include <ignition/math/Pose3.hh>
31#include "gazebo/gazebo_config.h"
47 class OpenALSourcePrivate;
64 public:
bool Load(sdf::ElementPtr _sdf = sdf::ElementPtr());
86 private: std::unique_ptr<OpenALPrivate> dataPtr;
105 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
126 public:
bool Load(sdf::ElementPtr _sdf);
131 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
199 private: std::unique_ptr<OpenALSourcePrivate> dataPtr;
util
Definition Diagnostics.hh:33
gazebo
Definition OpenAL.hh:37
util
Definition OpenAL.hh:37
Singleton template class.
Definition SingletonT.hh:34
OpenAL Listener.
Definition OpenAL.hh:95
virtual ~OpenALSink()
Destructor.
bool SetVelocity(const ignition::math::Vector3d &_vel)
Set the velocity of the sink.
bool SetPose(const ignition::math::Pose3d &_pose)
Set the position of the sink.
OpenAL Source.
Definition OpenAL.hh:116
std::vector< std::string > CollisionNames() const
Get a vector of all the collision names.
void Rewind()
Rewind the sound to the beginning.
void FillBufferFromFile(const std::string &_audioFile)
Fill the OpenAL audio buffer with data from a sound file.
void Pause()
Pause a sound.
bool IsPlaying()
Is the audio playing.
bool OnContact() const
Return true if the audio source is played on contact with another object.
bool SetVelocity(const ignition::math::Vector3d &_vel)
Set the velocity of the source.
bool FillBufferFromPCM(uint8_t *_pcmData, unsigned int _dataCount, int _sampleRate)
Fill the OpenAL audio buffer from PCM data.
bool SetGain(float _g)
Set the pitch of the source.
bool SetLoop(bool _state)
Set whether the source loops the audio.
bool Load(sdf::ElementPtr _sdf)
Load the source from sdf.
bool SetPitch(float _p)
Set the pitch of the source.
virtual ~OpenALSource()
Destructor.
bool HasCollisionName(const std::string &_name) const
Get whether the source has a collision name set.
OpenALSource()
Constructor.
bool SetPose(const ignition::math::Pose3d &_pose)
Set the position of the source.
3D audio setup and playback.
Definition OpenAL.hh:55
OpenALSourcePtr CreateSource(sdf::ElementPtr _sdf)
Create an OpenALSource object.
OpenALSinkPtr CreateSink(sdf::ElementPtr _sdf)
Create an audio listener.
std::set< std::string > DeviceList() const
Get a list of available audio devices.
bool Load(sdf::ElementPtr _sdf=sdf::ElementPtr())
Load the OpenAL server.
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition SingletonT.hh:58
std::shared_ptr< OpenALSource > OpenALSourcePtr
Definition UtilTypes.hh:48
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition UtilTypes.hh:44
Forward declarations for the common classes.
Definition Animation.hh:27