Audaspace 1.4.0
A high level audio library.
|
This device plays through OpenAL. More...
#include <OpenALDevice.h>
Public Member Functions | |
OpenALDevice (DeviceSpecs specs, int buffersize=AUD_DEFAULT_BUFFER_SIZE, std::string name="") | |
Opens the OpenAL audio device for playback. | |
virtual DeviceSpecs | getSpecs () const |
Returns the specification of the device. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< IReader > reader, bool keep=false) |
Plays a sound source. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< ISound > sound, bool keep=false) |
Plays a sound source. | |
virtual void | stopAll () |
Stops all playing sounds. | |
virtual void | lock () |
Locks the device. | |
virtual void | unlock () |
Unlocks the previously locked device. | |
virtual float | getVolume () const |
Retrieves the overall device volume. | |
virtual void | setVolume (float volume) |
Sets the overall device volume. | |
virtual ISynchronizer * | getSynchronizer () |
Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example. | |
virtual Vector3 | getListenerLocation () const |
Retrieves the listener location. | |
virtual void | setListenerLocation (const Vector3 &location) |
Sets the listener location. | |
virtual Vector3 | getListenerVelocity () const |
Retrieves the listener velocity. | |
virtual void | setListenerVelocity (const Vector3 &velocity) |
Sets the listener velocity. | |
virtual Quaternion | getListenerOrientation () const |
Retrieves the listener orientation. | |
virtual void | setListenerOrientation (const Quaternion &orientation) |
Sets the listener orientation. | |
virtual float | getSpeedOfSound () const |
Retrieves the speed of sound. | |
virtual void | setSpeedOfSound (float speed) |
Sets the speed of sound. | |
virtual float | getDopplerFactor () const |
Retrieves the doppler factor. | |
virtual void | setDopplerFactor (float factor) |
Sets the doppler factor. | |
virtual DistanceModel | getDistanceModel () const |
Retrieves the distance model. | |
virtual void | setDistanceModel (DistanceModel model) |
Sets the distance model. | |
![]() | |
virtual | ~IDevice () |
Destroys the device. | |
virtual DeviceSpecs | getSpecs () const =0 |
Returns the specification of the device. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< IReader > reader, bool keep=false)=0 |
Plays a sound source. | |
virtual std::shared_ptr< IHandle > | play (std::shared_ptr< ISound > sound, bool keep=false)=0 |
Plays a sound source. | |
virtual void | stopAll ()=0 |
Stops all playing sounds. | |
virtual void | lock ()=0 |
Locks the device. | |
virtual void | unlock ()=0 |
Unlocks the previously locked device. | |
virtual float | getVolume () const =0 |
Retrieves the overall device volume. | |
virtual void | setVolume (float volume)=0 |
Sets the overall device volume. | |
virtual ISynchronizer * | getSynchronizer ()=0 |
Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example. | |
virtual void | lock ()=0 |
Locks the object. | |
virtual void | unlock ()=0 |
Unlocks the previously locked object. | |
virtual Vector3 | getListenerLocation () const =0 |
Retrieves the listener location. | |
virtual void | setListenerLocation (const Vector3 &location)=0 |
Sets the listener location. | |
virtual Vector3 | getListenerVelocity () const =0 |
Retrieves the listener velocity. | |
virtual void | setListenerVelocity (const Vector3 &velocity)=0 |
Sets the listener velocity. | |
virtual Quaternion | getListenerOrientation () const =0 |
Retrieves the listener orientation. | |
virtual void | setListenerOrientation (const Quaternion &orientation)=0 |
Sets the listener orientation. | |
virtual float | getSpeedOfSound () const =0 |
Retrieves the speed of sound. | |
virtual void | setSpeedOfSound (float speed)=0 |
Sets the speed of sound. | |
virtual float | getDopplerFactor () const =0 |
Retrieves the doppler factor. | |
virtual void | setDopplerFactor (float factor)=0 |
Sets the doppler factor. | |
virtual DistanceModel | getDistanceModel () const =0 |
Retrieves the distance model. | |
virtual void | setDistanceModel (DistanceModel model)=0 |
Sets the distance model. | |
Static Public Member Functions | |
static std::list< std::string > | getDeviceNames () |
Retrieves a list of available hardware devices to open with OpenAL. | |
static void | registerPlugin () |
Registers this plugin. | |
This device plays through OpenAL.
OpenALDevice::OpenALDevice | ( | DeviceSpecs | specs, |
int | buffersize = AUD_DEFAULT_BUFFER_SIZE , |
||
std::string | name = "" |
||
) |
Opens the OpenAL audio device for playback.
specs | The wanted audio specification. |
buffersize | The size of the internal buffer. |
name | The name of the device to be opened. |
DeviceException | Thrown if the audio device cannot be opened. |
|
static |
Retrieves a list of available hardware devices to open with OpenAL.
|
virtual |
|
virtual |
Retrieves the doppler factor.
This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.
Implements I3DDevice.
|
virtual |
|
virtual |
Retrieves the listener orientation.
Implements I3DDevice.
|
virtual |
|
virtual |
Returns the specification of the device.
Implements IDevice.
|
virtual |
Retrieves the speed of sound.
This value is needed for doppler effect calculation.
Implements I3DDevice.
|
virtual |
Retrieves the synchronizer for this device, which enables accurate synchronization between audio playback and video playback for example.
Implements IDevice.
|
virtual |
|
virtual |
Locks the device.
Used to make sure that between lock and unlock, no buffers are read, so that it is possible to start, resume, pause, stop or seek several playback handles simultaneously.
Implements IDevice.
|
virtual |
Plays a sound source.
reader | The reader to play. |
keep | When keep is true the sound source will not be deleted but set to paused when its end has been reached. |
Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements IDevice.
|
virtual |
Plays a sound source.
sound | The sound to create the reader for the sound source. |
keep | When keep is true the sound source will not be deleted but set to paused when its end has been reached. |
Exception | Thrown if there's an unexpected (from the device side) error during creation of the reader. |
Implements IDevice.
|
virtual |
|
virtual |
Sets the doppler factor.
This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.
factor | The new doppler factor. |
Implements I3DDevice.
|
virtual |
Sets the listener location.
location | The new location. |
Implements I3DDevice.
|
virtual |
Sets the listener orientation.
orientation | The new orientation as quaternion. |
Implements I3DDevice.
|
virtual |
Sets the listener velocity.
velocity | The new velocity. |
Implements I3DDevice.
|
virtual |
Sets the speed of sound.
This value is needed for doppler effect calculation.
speed | The new speed of sound. |
Implements I3DDevice.
|
virtual |
|
virtual |
Stops all playing sounds.
Implements IDevice.
|
virtual |
Unlocks the previously locked device.
Implements IDevice.