Audaspace
1.3.0
A high level audio library.
|
Go to the documentation of this file.
164 SoftwareHandle(
SoftwareDevice* device, std::shared_ptr<IReader> reader, std::shared_ptr<PitchReader> pitch, std::shared_ptr<ResampleReader> resampler, std::shared_ptr<ChannelMapperReader> mapper,
bool keep);
183 virtual bool seek(
float position);
279 std::list<std::shared_ptr<SoftwareHandle> > m_playingSounds;
284 std::list<std::shared_ptr<SoftwareHandle> > m_pausedSounds;
294 std::recursive_mutex m_mutex;
311 float m_speed_of_sound;
314 float m_doppler_factor;
345 virtual std::shared_ptr<IHandle>
play(std::shared_ptr<IReader> reader,
bool keep =
false);
346 virtual std::shared_ptr<IHandle>
play(std::shared_ptr<ISound> sound,
bool keep =
false);
Specification of a sound source.
Definition: Specification.h:110
virtual float getConeAngleInner()
Retrieves the inner opening angle of the cone of a source.
virtual std::shared_ptr< IHandle > play(std::shared_ptr< IReader > reader, bool keep=false)
Plays a sound source.
virtual float getAttenuation()
Retrieves the attenuation of a source.
std::shared_ptr< Mixer > m_mixer
The mixer.
Definition: SoftwareDevice.h:228
std::shared_ptr< ResampleReader > m_resampler
The resample reader in between.
Definition: SoftwareDevice.h:70
Defines the I3DDevice interface as well as the different distance models.
void setQuality(bool quality)
Sets the resampling quality.
virtual DeviceSpecs getSpecs() const
Returns the specification of the device.
virtual bool seek(float position)
Seeks in a played back sound.
std::shared_ptr< PitchReader > m_pitch
The pitch reader in between.
Definition: SoftwareDevice.h:67
int m_loopcount
The loop count of the source.
Definition: SoftwareDevice.h:94
virtual bool setDistanceMaximum(float distance)
Sets the maximum distance of a source.
virtual bool setOrientation(const Quaternion &orientation)
Sets the orientation of the source.
This abstract class is able to mix audiosignals with same channel count and sample rate and convert i...
Definition: Mixer.h:40
virtual void unlock()
Unlocks the previously locked device.
void update()
Updates the handle's playback parameters.
void setSpecs(Specs specs)
Sets the audio output specification of the device.
virtual ISynchronizer * getSynchronizer()
Retrieves the synchronizer for this device, which enables accurate synchronization between audio play...
void * m_stop_data
Stop callback data.
Definition: SoftwareDevice.h:139
Status m_status
Current status of the handle.
Definition: SoftwareDevice.h:142
This class reads another reader and changes it's pitch.
Definition: PitchReader.h:33
virtual void setVolume(float volume)
Sets the overall device volume.
virtual void setListenerLocation(const Vector3 &location)
Sets the listener location.
virtual void setSpeedOfSound(float speed)
Sets the speed of sound.
void(* stopCallback)(void *)
The stopCallback is called when a handle reaches the end of the stream and thus gets stopped.
Definition: IHandle.h:42
This is the base class for all resampling readers.
Definition: ResampleReader.h:33
virtual bool setRelative(bool relative)
Sets whether the source location, velocity and orientation are relative to the listener.
Specification of a sound device.
Definition: Specification.h:120
virtual bool setVelocity(const Vector3 &velocity)
Sets the velocity of the source.
DistanceModel
Possible distance models for the 3D device.
Definition: I3DDevice.h:35
This class enables global synchronization of several audio applications if supported.
Definition: ISynchronizer.h:39
virtual bool getKeep()
Gets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
virtual DistanceModel getDistanceModel() const
Retrieves the distance model.
bool m_keep
Whether to keep the source if end of it is reached.
Definition: SoftwareDevice.h:76
float m_user_pitch
The user set pitch of the source.
Definition: SoftwareDevice.h:79
virtual float getConeVolumeOuter()
Retrieves the outer volume of the cone of a source.
SoftwareDevice()
Empty default constructor.
virtual void playing(bool playing)=0
This function tells the device, to start or pause playback.
virtual void setListenerVelocity(const Vector3 &velocity)
Sets the listener velocity.
This class is a default ISynchronizer implementation that actually does no synchronization and is int...
Definition: DefaultSynchronizer.h:34
virtual bool pause()
Pauses a played back sound.
This class maps a sound source's channels to a specific output channel count.
Definition: ChannelMapperReader.h:35
The DefaultSynchronizer class.
virtual bool setLoopCount(int count)
Sets the loop count of a playing sound.
virtual float getConeAngleOuter()
Retrieves the outer opening angle of the cone of a source.
void create()
Initializes member variables.
int m_flags
Rendering flags.
Definition: SoftwareDevice.h:133
virtual float getVolume()
Retrieves the volume of a playing sound.
virtual bool setVolume(float volume)
Sets the volume of a playing sound.
stopCallback m_stop
The stop callback.
Definition: SoftwareDevice.h:136
void setSpecs(Specs specs)
Sets the audio output specification of the readers.
SoftwareDevice * m_device
Own device.
Definition: SoftwareDevice.h:145
DeviceSpecs m_specs
The specification of the device.
Definition: SoftwareDevice.h:223
The I3DHandle interface represents a playback handle for 3D sources.
Definition: I3DHandle.h:39
float m_distance_max
Maximum distance.
Definition: SoftwareDevice.h:115
virtual bool setDistanceReference(float distance)
Sets the reference distance of a source.
virtual float getDistanceReference()
Retrieves the reference distance of a source.
virtual bool setVolumeMaximum(float volume)
Sets the maximum volume of a source.
This class represents a 3 dimensional vector.
Definition: Math3D.h:36
virtual bool isRelative()
Checks whether the source location, velocity and orientation are relative to the listener.
float m_old_volume
The previous calculated final volume of the source.
Definition: SoftwareDevice.h:91
float m_cone_angle_inner
Cone inner angle.
Definition: SoftwareDevice.h:127
virtual bool setConeVolumeOuter(float volume)
Sets the outer volume of the cone of a source.
virtual bool setKeep(bool keep)
Sets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
virtual void lock()
Locks the device.
std::shared_ptr< IReader > m_reader
The reader source.
Definition: SoftwareDevice.h:64
float m_volume_min
Minimum volume.
Definition: SoftwareDevice.h:112
float m_cone_angle_outer
Cone outer angle.
Definition: SoftwareDevice.h:124
virtual bool setLocation(const Vector3 &location)
Sets the location of the source.
Saves the data for playback.
Definition: SoftwareDevice.h:56
virtual float getSpeedOfSound() const
Retrieves the speed of sound.
virtual float getDistanceMaximum()
Retrieves the maximum distance of a source.
float m_user_pan
The user set panning for non-3D sources.
Definition: SoftwareDevice.h:85
bool m_relative
Whether the position to the listener is relative or absolute.
Definition: SoftwareDevice.h:106
virtual Vector3 getVelocity()
Retrieves the velocity of the source.
bool pause(bool keep)
This method is for internal use only.
This class represents a quaternion used for 3D rotations.
Definition: Math3D.h:206
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition: Buffer.h:34
unsigned char data_t
Sample data type (format samples)
Definition: Audaspace.h:129
virtual bool resume()
Resumes a paused sound.
bool m_quality
Whether to do high or low quality resampling.
Definition: SoftwareDevice.h:233
virtual float getPosition()
Retrieves the current playback position of a sound.
virtual void stopAll()
Stops all playing sounds.
float m_user_volume
The user set volume of the source.
Definition: SoftwareDevice.h:82
The IDevice interface represents an output device for sound sources.
Definition: IDevice.h:47
The I3DDevice interface represents an output device for 3D sound.
Definition: I3DDevice.h:53
virtual float getVolumeMinimum()
Retrieves the minimum volume of a source.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
virtual bool setStopCallback(stopCallback callback=0, void *data=0)
Sets the callback function that's called when the end of a playing sound is reached.
float m_distance_reference
Reference distance;.
Definition: SoftwareDevice.h:118
float m_attenuation
Attenuation.
Definition: SoftwareDevice.h:121
void mix(data_t *buffer, int length)
Mixes the next samples into the buffer.
virtual void setDistanceModel(DistanceModel model)
Sets the distance model.
virtual bool stop()
Stops a played back or paused sound.
virtual float getPitch()
Retrieves the pitch of a playing sound.
virtual void setDopplerFactor(float factor)
Sets the doppler factor.
virtual int getLoopCount()
Retrieves the loop count of a playing sound.
virtual Status getStatus()
Returns the status of a played back sound.
virtual float getVolume() const
Retrieves the overall device volume.
virtual float getVolumeMaximum()
Retrieves the maximum volume of a source.
float m_volume
The calculated final volume of the source.
Definition: SoftwareDevice.h:88
The IHandle interface represents a playback handles of a specific device.
Definition: IHandle.h:49
virtual Vector3 getListenerLocation() const
Retrieves the listener location.
virtual float getDopplerFactor() const
Retrieves the doppler factor.
virtual bool setVolumeMinimum(float volume)
Sets the minimum volume of a source.
virtual void setListenerOrientation(const Quaternion &orientation)
Sets the listener orientation.
virtual Vector3 getListenerVelocity() const
Retrieves the listener velocity.
Vector3 m_velocity
Velocity in 3D Space.
Definition: SoftwareDevice.h:100
SoftwareHandle(SoftwareDevice *device, std::shared_ptr< IReader > reader, std::shared_ptr< PitchReader > pitch, std::shared_ptr< ResampleReader > resampler, std::shared_ptr< ChannelMapperReader > mapper, bool keep)
Creates a new software handle.
virtual bool setConeAngleInner(float angle)
Sets the inner opening angle of the cone of a source.
virtual bool setAttenuation(float factor)
Sets the attenuation of a source.
float m_volume_max
Maximum volume.
Definition: SoftwareDevice.h:109
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
Defines the IHandle interface as well as possible states of the handle.
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
float m_cone_volume_outer
Cone outer volume.
Definition: SoftwareDevice.h:130
virtual std::shared_ptr< IHandle > play(std::shared_ptr< ISound > sound, bool keep=false)
Plays a sound source.
virtual bool setConeAngleOuter(float angle)
Sets the outer opening angle of the cone of a source.
virtual bool setPitch(float pitch)
Sets the pitch of a playing sound.
void destroy()
Uninitializes member variables.
The software device is a generic device with software mixing.
Definition: SoftwareDevice.h:52
static void setPanning(IHandle *handle, float pan)
Sets the panning of a specific handle.
virtual Quaternion getOrientation()
Retrieves the orientation of the source.
Vector3 m_location
Location in 3D Space.
Definition: SoftwareDevice.h:97
std::shared_ptr< ChannelMapperReader > m_mapper
The channel mapper reader in between.
Definition: SoftwareDevice.h:73
virtual Vector3 getLocation()
Retrieves the location of the source.
virtual Quaternion getListenerOrientation() const
Retrieves the listener orientation.
Quaternion m_orientation
Orientation in 3D Space.
Definition: SoftwareDevice.h:103
Status
Status of a playback handle.
Definition: IHandle.h:31