Go to the documentation of this file.
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;
60 private:
virtual ~
OpenAL();
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;
bool SetLoop(bool _state)
Set whether the source loops the audio.
bool IsPlaying()
Is the audio playing.
Forward declarations for the common classes.
Definition: Animation.hh:27
gazebo
Definition: OpenAL.hh:37
virtual ~OpenALSource()
Destructor.
3D audio setup and playback.
Definition: OpenAL.hh:55
bool HasCollisionName(const std::string &_name) const
Get whether the source has a collision name set.
bool SetVelocity(const ignition::math::Vector3d &_vel)
Set the velocity of the source.
std::set< std::string > DeviceList() const
Get a list of available audio devices.
Singleton template class.
Definition: SingletonT.hh:34
std::shared_ptr< OpenALSource > OpenALSourcePtr
Definition: UtilTypes.hh:48
bool SetPose(const ignition::math::Pose3d &_pose)
Set the position of the source.
util
Definition: OpenAL.hh:37
bool OnContact() const
Return true if the audio source is played on contact with another object.
OpenAL Listener. This can be thought of as a microphone.
Definition: OpenAL.hh:95
void Pause()
Pause a sound.
bool SetVelocity(const ignition::math::Vector3d &_vel)
Set the velocity of the sink.
bool FillBufferFromPCM(uint8_t *_pcmData, unsigned int _dataCount, int _sampleRate)
Fill the OpenAL audio buffer from PCM data.
virtual ~OpenALSink()
Destructor.
bool SetGain(float _g)
Set the pitch of the source.
void FillBufferFromFile(const std::string &_audioFile)
Fill the OpenAL audio buffer with data from a sound file.
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition: UtilTypes.hh:44
bool SetPitch(float _p)
Set the pitch of the source.
bool Load(sdf::ElementPtr _sdf=sdf::ElementPtr())
Load the OpenAL server.
OpenALSource()
Constructor.
OpenALSourcePtr CreateSource(sdf::ElementPtr _sdf)
Create an OpenALSource object.
void Rewind()
Rewind the sound to the beginning.
std::vector< std::string > CollisionNames() const
Get a vector of all the collision names.
bool SetPose(const ignition::math::Pose3d &_pose)
Set the position of the sink.
OpenAL Source. This can be thought of as a speaker.
Definition: OpenAL.hh:116
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
bool Load(sdf::ElementPtr _sdf)
Load the source from sdf.
OpenALSinkPtr CreateSink(sdf::ElementPtr _sdf)
Create an audio listener.