Sound file loaded into memory that can be played on an AudioChannel.
More...
Inherits G3D::ReferenceCountedObject.
|
| | ~Sound () |
| |
| const String & | name () const |
| |
| shared_ptr< AudioChannel > | play (float initialVolume=1.0f, float initialPan=0.0f, float initialFrequency=DEFAULT_FREQUENCY, bool startPaused=false) |
| | Returns the channel on which the sound is playing so that it can be terminated or adjusted. More...
|
| |
| shared_ptr< AudioChannel > | play (const Point3 &initialPosition, const Vector3 &initialVelocity, float initialVolume=1.0f, float initialFrequency=DEFAULT_FREQUENCY, bool startPaused=false) |
| | Play a positional sound. More...
|
| |
| Any | toAny () const |
| |
|
| static shared_ptr< Sound > | create (const String &filename, bool loop=false, bool positional=false) |
| |
| static shared_ptr< Sound > | create (const Any &a) |
| | Positional defaults to true for this constructor. More...
|
| |
|
| template<class T , class ... ArgTypes> |
| static shared_ptr< T > | createShared (ArgTypes &&... args) |
| | Like std::make_shared, but works for protected constructors. More...
|
| |
Sound file loaded into memory that can be played on an AudioChannel.
Analogous to a graphics texture...a (typically) read-only value that can be
- See also
- AudioChannel
◆ Sound()
◆ ~Sound()
◆ cleanup()
| void G3D::Sound::cleanup |
( |
| ) |
|
|
protected |
◆ create() [1/2]
| static shared_ptr<Sound> G3D::Sound::create |
( |
const String & |
filename, |
|
|
bool |
loop = false, |
|
|
bool |
positional = false |
|
) |
| |
|
static |
- Parameters
-
| positional | Set to true for 3D audio |
◆ create() [2/2]
| static shared_ptr<Sound> G3D::Sound::create |
( |
const Any & |
a | ) |
|
|
static |
Positional defaults to true for this constructor.
◆ createShared()
template<class T , class ... ArgTypes>
| static shared_ptr<T> G3D::ReferenceCountedObject::createShared |
( |
ArgTypes &&... |
args | ) |
|
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
◆ name()
| const String& G3D::Sound::name |
( |
| ) |
const |
|
inline |
◆ play() [1/2]
| shared_ptr<AudioChannel> G3D::Sound::play |
( |
float |
initialVolume = 1.0f, |
|
|
float |
initialPan = 0.0f, |
|
|
float |
initialFrequency = DEFAULT_FREQUENCY, |
|
|
bool |
startPaused = false |
|
) |
| |
◆ play() [2/2]
◆ toAny()
| Any G3D::Sound::toAny |
( |
| ) |
const |
◆ AudioChannel
◆ AudioDevice
◆ DEFAULT_FREQUENCY
| const int16 G3D::Sound::DEFAULT_FREQUENCY = -1 |
|
static |
◆ m_filename
◆ m_fmodSound
| FMOD::Sound* G3D::Sound::m_fmodSound |
|
protected |
◆ m_loop
◆ m_name
◆ m_positional
| bool G3D::Sound::m_positional |
|
protected |