Classes | Enumerations | Functions | Variables

AUDIO Namespace Reference

Audio. More...

Classes

class  Buffer
 Represents a container for sound data, and handles the details of storage and streaming. This is a reference counted object, so all copies of the object refer to the same thing, and the object's data will only be freed once all copies are freed. More...
class  Player
 Used to play sound buffers. This is a reference counted object, so all copies of the object refer to the same thing, and the object's data will only be freed once all copies are freed. More...
class  Source
 Represents a source of sound sample data. More...
class  LoopSource
 Source that creates a streaming infinite length loop from another source. If reading data reaches the end or the loop endpoint, it seeks back to the loop start point. More...
class  WavFileSource
 Reads sound from a .wav file. More...
class  VorbisFileSource
 Reads sound from a .ogg/.ogm file. More...
class  FlacFileSource
 Reads sound from a .flac file. More...
class  MonoToStereoSource
 Combines two mono sources into a stereo source. More...
class  EmptySource
 Generates nothing. More...
class  WhiteNoiseSource
 White noise generator. More...

Enumerations

enum  BufferBehavior { STATIC_DATA = 0x100, STREAM_DATA }
 

Determines how the buffer stores data, and how it reads data from its source.

More...
enum  DistanceModel {
  DISTANCE_NONE = 0x300, DISTANCE_INVERSE, DISTANCE_INVERSE_CLAMPED, DISTANCE_LINEAR,
  DISTANCE_LINEAR_CLAMPED, DISTANCE_EXPONENTIAL, DISTANCE_EXPONENTIAL_CLAMPED
}
 

Determines how distance affects the volume of 3D sounds. Most of the parameters used here can be found in the Player class (See Player.h).

More...
enum  RenderMode { POSITIONAL = 0x200, FIXED }
 

Determines how the sound should be played back.

More...

Functions

void SetGlobalVolume (float value)
 Sets the global sound volume level that affects all sounds. Value can be from 0 being silence to 1 being normal. Default is 1.
void SetListenerPosition (float x, float y, float z)
 Sets the position the listener is at.
void SetListenerFacing (float x, float y, float z)
 Sets the direction the listener is facing.
void SetListenerUp (float x, float y, float z)
 Sets the direction that is up from the listener's head.
void SetListenerVelocity (float x, float y, float z)
 Sets the speed and direction that listener is moving. (used for doppler).
void SetDopplerFactor (float value)
 A scalar(>=0) that is can be used to emphasize or reduce the doppler effect globally. Default is 1. Setting to 0 disables doppler.
void SetSpeedOfSound (float value)
 Sets the speed of sound used for doppler calculations. Must be >0. Default is 343.3.
void SetDistanceModel (DistanceModel distanceModel)
 Sets the formula used to calculate how distance affects the volume of sounds in 3D space.
template<typename VectorType >
void SetListenerPosition (const VectorType &pos)
 Sets the position the listener is at.
template<typename VectorType >
void SetListenerFacing (const VectorType &dir)
 Sets the direction the listener is facing.
template<typename VectorType >
void SetListenerUp (const VectorType &up)
 Sets the direction that is up from the listener's head.
template<typename VectorType >
void SetListenerVelocity (const VectorType &vel)
 Sets the speed and direction that listener is moving. (used for doppler).

Variables

const nuint FINITE_DATA = (nuint)(0-2)
 There is a finite amount of data left, but the source doesn't know exactly how much.
const nuint INFINITE_DATA = (nuint)(0-1)
 The source will never run out of data.

Detailed Description

Audio.

Sound playback and streaming.


Enumeration Type Documentation

Determines how the buffer stores data, and how it reads data from its source.

Enumerator:
STATIC_DATA 

Stores the full data in hardware device memory if possible, otherwise stores it in system memory. The data is fully read from the source only once, and the source must be of finite length. Recommended for most sound effects.

STREAM_DATA 

Data is pulled from the source in small pieces as it is needed, which are stored in system memory. The source may be duplicated each time it is played, in order to provide a separate streaming data source. This is the only valid option for infinite length data sources.

Determines how distance affects the volume of 3D sounds. Most of the parameters used here can be found in the Player class (See Player.h).

Enumerator:
DISTANCE_NONE 

Distance does not affect sound volume.

DISTANCE_INVERSE 

Works like 1/distance. (default) The exact volume scale is: ReferenceDistance / (ReferenceDistance + RolloffFactor * (distance - ReferenceDistance)).

DISTANCE_INVERSE_CLAMPED 

Same as DISTANCE_INVERSE, except the distance used in the calculation is clamped between ReferenceDistance and MaxDistance.

DISTANCE_LINEAR 

Works like 1-distance. The exact volume scale is: 1 - RolloffFactor * (distance - ReferenceDistance) / (MaxDistance - ReferenceDistance). The distance is clamped between 0 and MaxDistance.

DISTANCE_LINEAR_CLAMPED 

Same as DISTANCE_LINEAR, except the distance is clamped between ReferenceDistance and MaxDistance.

DISTANCE_EXPONENTIAL 

Works like distance^(-n). The exact volume scale is (distance / ReferenceDistance) ^ (-RolloffFactor).

DISTANCE_EXPONENTIAL_CLAMPED 

Same as DISTANCE_EXPONENTIAL, except the distance is clamped between ReferenceDistance and MaxDistance.

Determines how the sound should be played back.

Enumerator:
POSITIONAL 

The sound has a 3D position and orientation in space. Only mono sound sources may be used with this (stereo sources are automatically collapsed to mono).

FIXED 

The sound is played without any 3D positioning applied. This must be used to play stereo sources correctly.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends