Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Audio class that represents a sound. More...
Public Member Functions | |
Sound (const SoundBuffer *soundBuffer) | |
Constructs a Sound object. More... | |
Sound (const Sound &sound) | |
Constructs a Sound object which is a copy of another. More... | |
Sound (Sound &&)=default | |
~Sound () | |
Destructs the object and calls Stop. More... | |
void | EnableLooping (bool loop) override |
Enables the looping of the music. More... | |
const SoundBuffer * | GetBuffer () const |
Gets the internal buffer. More... | |
UInt32 | GetDuration () const override |
Gets the duration of the sound. More... | |
UInt32 | GetPlayingOffset () const override |
Gets the current offset in the sound. More... | |
SoundStatus | GetStatus () const override |
Gets the status of the music. More... | |
bool | IsLooping () const override |
Checks whether the sound is looping. More... | |
bool | IsPlayable () const |
Checks whether the sound is playable. More... | |
bool | IsPlaying () const |
Checks whether the sound is playing. More... | |
bool | LoadFromFile (const String &filePath, const SoundBufferParams ¶ms=SoundBufferParams()) |
Loads the sound from file. More... | |
bool | LoadFromMemory (const void *data, std::size_t size, const SoundBufferParams ¶ms=SoundBufferParams()) |
Loads the sound from memory. More... | |
bool | LoadFromStream (Stream &stream, const SoundBufferParams ¶ms=SoundBufferParams()) |
Loads the sound from stream. More... | |
void | Pause () override |
Pauses the sound. | |
void | Play () override |
Plays the music. More... | |
void | SetBuffer (const SoundBuffer *buffer) |
Sets the internal buffer. More... | |
void | SetPlayingOffset (UInt32 offset) |
Sets the playing offset for the sound. More... | |
void | Stop () override |
Stops the sound. | |
Sound & | operator= (const Sound &)=delete |
Sound & | operator= (Sound &&)=default |
TODO? | |
Public Member Functions inherited from Nz::SoundEmitter | |
virtual | ~SoundEmitter () |
Destructs the object. | |
void | EnableSpatialization (bool spatialization) |
Enables spatialization. More... | |
float | GetAttenuation () const |
Gets the attenuation. More... | |
float | GetMinDistance () const |
Gets the minimum distance to hear. More... | |
float | GetPitch () const |
Gets the pitch. More... | |
Vector3f | GetPosition () const |
Gets the position of the emitter. More... | |
Vector3f | GetVelocity () const |
Gets the velocity of the emitter. More... | |
float | GetVolume () const |
Gets the volume of the emitter. More... | |
bool | IsSpatialized () const |
Checks whether the sound emitter has spatialization enabled. More... | |
void | SetAttenuation (float attenuation) |
Sets the attenuation. More... | |
void | SetMinDistance (float minDistance) |
Sets the minimum distance to hear. More... | |
void | SetPitch (float pitch) |
Sets the pitch. More... | |
void | SetPosition (const Vector3f &position) |
Sets the position of the emitter. More... | |
void | SetPosition (float x, float y, float z) |
Sets the position of the emitter. More... | |
void | SetVelocity (const Vector3f &velocity) |
Sets the velocity of the emitter. More... | |
void | SetVelocity (float velX, float velY, float velZ) |
Sets the velocity of the emitter. More... | |
void | SetVolume (float volume) |
Sets the volume of the emitter. More... | |
SoundEmitter & | operator= (const SoundEmitter &)=delete |
SoundEmitter & | operator= (SoundEmitter &&)=delete |
TODO. | |
Additional Inherited Members | |
Protected Member Functions inherited from Nz::SoundEmitter | |
SoundEmitter () | |
Constructs a SoundEmitter object. | |
SoundEmitter (const SoundEmitter &emitter) | |
Constructs a SoundEmitter object which is a copy of another. More... | |
SoundEmitter (SoundEmitter &&)=delete | |
SoundStatus | GetInternalStatus () const |
Gets the status of the sound emitter. More... | |
Protected Attributes inherited from Nz::SoundEmitter | |
unsigned int | m_source |
Nz::Sound::Sound | ( | const SoundBuffer * | soundBuffer | ) |
Constructs a Sound object.
soundBuffer | Buffer to read sound from |
Nz::Sound::Sound | ( | const Sound & | sound | ) |
Nz::Sound::~Sound | ( | ) |
Destructs the object and calls Stop.
|
overridevirtual |
const SoundBuffer * Nz::Sound::GetBuffer | ( | ) | const |
Gets the internal buffer.
|
overridevirtual |
Gets the duration of the sound.
Implements Nz::SoundEmitter.
|
overridevirtual |
Gets the current offset in the sound.
Implements Nz::SoundEmitter.
|
overridevirtual |
Gets the status of the music.
Implements Nz::SoundEmitter.
|
overridevirtual |
bool Nz::Sound::IsPlayable | ( | ) | const |
Checks whether the sound is playable.
bool Nz::Sound::IsPlaying | ( | ) | const |
Checks whether the sound is playing.
bool Nz::Sound::LoadFromFile | ( | const String & | filePath, |
const SoundBufferParams & | params = SoundBufferParams() |
||
) |
Loads the sound from file.
filePath | Path to the file |
params | Parameters for the sound |
bool Nz::Sound::LoadFromMemory | ( | const void * | data, |
std::size_t | size, | ||
const SoundBufferParams & | params = SoundBufferParams() |
||
) |
Loads the sound from memory.
data | Raw memory |
size | Size of the memory |
params | Parameters for the sound |
bool Nz::Sound::LoadFromStream | ( | Stream & | stream, |
const SoundBufferParams & | params = SoundBufferParams() |
||
) |
Loads the sound from stream.
stream | Stream to the sound |
params | Parameters for the sound |
|
overridevirtual |
Plays the music.
Implements Nz::SoundEmitter.
void Nz::Sound::SetBuffer | ( | const SoundBuffer * | buffer | ) |
Sets the internal buffer.
buffer | Internal buffer |
void Nz::Sound::SetPlayingOffset | ( | UInt32 | offset | ) |
Sets the playing offset for the sound.
offset | Offset in the sound in milliseconds |