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...
#include <Player.h>
Inherits ReferenceCountedData< InternalSharedPlayerData >.
Public Member Functions | |
bool | Play (Buffer &buffer, RenderMode mode) |
Starts playing a buffer on this player. If the player was already playing something, the previous sound is stopped. Returns true if the sound could be played. | |
void | Stop () |
Stops the currently playing sound. | |
bool | IsPlaying () const |
Returns whether a sound is still being played by this player. | |
void | SetVolume (float value) |
Sets the global sound volume level for this player. Value can be from 0 being silence to 1 being normal. Default is 1. | |
void | SetPitchMultiplier (float value) |
Sets a pitch multiplier for the sound (must be >0). | |
void | SetPosition (float x, float y, float z) |
Sets the 3D position that the sound is located at. | |
template<typename VectorType > | |
void | SetPosition (const VectorType &pos) |
Sets the 3D position that the sound is located at. | |
void | SetVelocity (float x, float y, float z) |
Sets the speed and direction that sound is moving. (used for doppler). | |
template<typename VectorType > | |
void | SetVelocity (const VectorType &vel) |
Sets the speed and direction that sound is moving. (used for doppler). | |
void | SetCone (float dirX, float dirY, float dirZ, float coneInnerAngle, float coneOutterAngle, float coneOutterAngleVolume) |
Sets the sound's output to be restricted to a cone pointing in a specific direction. Sounds within the inner angle are normal volume, while sounds outside the outter angle are coneOutterAngleVolume volume(from 0 to 1). Angles are in radians. | |
template<typename VectorType > | |
void | SetCone (const VectorType &dir, float coneInnerAngle, float coneOutterAngle, float coneOutterAngleVolume) |
Sets the sound's output to be restricted to a cone pointing in a specific direction. Sounds within the inner angle are normal volume, while sounds outside the outter angle are coneOutterAngleVolume volume(from 0 to 1). Angles are in radians. | |
void | SetDistanceVolumeLimits (float minVolume, float maxVolume) |
This sets the minimum and maximum volume the sound can be scaled. This is applied after the current distance model's effect is applied. | |
void | SetReferenceDistance (float value) |
Sets this player's ReferenceDistance for the current distance model (see Listener.h). | |
void | SetMaxDistance (float value) |
Sets this player's MaxDistance for the current distance model (see Listener.h). | |
void | SetRolloffFactor (float value) |
Sets this player's RolloffFactor for the current distance model (see Listener.h). | |
Static Public Member Functions | |
static void | SetDefaultVolume (float value) |
Sets the default value for SetVolume, which is applied to newly created Players. | |
static void | SetDefaultPitchMultiplier (float value) |
Sets the default value for SetPitchMultiplier, which is applied to newly created Players. | |
static void | SetDefaultDistanceVolumeLimits (float minVolume, float maxVolume) |
Sets the default value for SetDistanceVolumeLimits, which is applied to newly created Players. | |
static void | SetDefaultReferenceDistance (float value) |
Sets the default value for SetReferenceDistance, which is applied to newly created Players. | |
static void | SetDefaultMaxDistance (float value) |
Sets the default value for SetMaxDistance, which is applied to newly created Players. | |
static void | SetDefaultRolloffFactor (float value) |
Sets the default value for SetRolloffFactor, which is applied to newly created Players. |
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.