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"
44 class OpenALSourcePrivate;
51 class GZ_UTIL_VISIBLE OpenAL :
public SingletonT<OpenAL>
57 private:
virtual ~OpenAL();
61 public:
bool Load(sdf::ElementPtr _sdf = sdf::ElementPtr());
79 public: std::set<std::string> DeviceList()
const;
83 private: std::unique_ptr<OpenALPrivate> dataPtr;
91 class GZ_UTIL_VISIBLE OpenALSink
97 public:
virtual ~OpenALSink();
102 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
107 public:
bool SetVelocity(
const ignition::math::Vector3d &_vel);
112 class GZ_UTIL_VISIBLE OpenALSource
115 public: OpenALSource();
118 public:
virtual ~OpenALSource();
123 public:
bool Load(sdf::ElementPtr _sdf);
128 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
133 public:
bool SetVelocity(
const ignition::math::Vector3d &_vel);
138 public:
bool SetPitch(
float _p);
143 public:
bool SetGain(
float _g);
148 public:
bool SetLoop(
bool _state);
155 public:
bool OnContact()
const;
160 public: std::vector<std::string> CollisionNames()
const;
165 public:
bool HasCollisionName(
const std::string &_name)
const;
171 public:
void Pause();
177 public:
void Rewind();
180 public:
bool IsPlaying();
187 public:
bool FillBufferFromPCM(uint8_t *_pcmData,
unsigned int _dataCount,
192 public:
void FillBufferFromFile(
const std::string &_audioFile);
196 private: std::unique_ptr<OpenALSourcePrivate> dataPtr;
Singleton template class.
Definition: SingletonT.hh:33
std::shared_ptr< OpenALSource > OpenALSourcePtr
Definition: UtilTypes.hh:48
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition: UtilTypes.hh:44