Wave/Sound management functions.
More...
#include <Sound.hpp>
|
| | Sound (::AudioStream stream, unsigned int frameCount) |
| |
| | Sound (const ::Wave &wave) |
| | Loads a sound from the given Wave.
|
| |
|
| Sound (const Sound &)=delete |
| |
| | Sound (const std::string &fileName) |
| | Loads a sound from the given file.
|
| |
| | Sound (Sound &&other) noexcept |
| |
| unsigned int | GetFrameCount () const |
| | Retrieves the frameCount value for the object.
|
| |
| ::AudioStream | GetStream () const |
| | Retrieves the stream value for the object.
|
| |
| bool | IsPlaying () const |
| | Check if a sound is currently playing.
|
| |
| bool | IsValid () const |
| | Retrieve whether or not the Sound buffer is loaded.
|
| |
| void | Load (const ::Wave &wave) |
| | Loads the given Wave object into the Sound.
|
| |
| void | Load (const std::string &fileName) |
| | Load a sound from the given file.
|
| |
|
Sound & | operator= (const Sound &)=delete |
| |
| Sound & | operator= (Sound &&other) noexcept |
| |
| Sound & | Pause () |
| | Pause a sound.
|
| |
| Sound & | Play () |
| | Play a sound.
|
| |
| Sound & | Resume () |
| | Resume a paused sound.
|
| |
| Sound & | SetPan (float pan=0.5f) |
| | Set pan for a sound (0.5 is center)
|
| |
| Sound & | SetPitch (float pitch) |
| | Set pitch for a sound (1.0 is base level)
|
| |
| Sound & | SetVolume (float volume) |
| | Set volume for a sound (1.0 is max level)
|
| |
| Sound & | Stop () |
| | Stop playing a sound.
|
| |
| void | Unload () |
| | Unload sound.
|
| |
| Sound & | Update (const void *data) |
| | Update sound buffer with new data, assuming it's the same sample count.
|
| |
| Sound & | Update (const void *data, int samplesCount) |
| | Update sound buffer with new data.
|
| |
|
| void | set (const ::Sound &sound) |
| |
Wave/Sound management functions.
boom.Play();
Wave/Sound management functions.
Definition at line 19 of file Sound.hpp.
◆ Sound() [1/5]
◆ Sound() [2/5]
| raylib::Sound::Sound |
( |
::AudioStream |
stream, |
|
|
unsigned int |
frameCount |
|
) |
| |
|
inline |
◆ Sound() [3/5]
| raylib::Sound::Sound |
( |
Sound && |
other | ) |
|
|
inlinenoexcept |
◆ Sound() [4/5]
| raylib::Sound::Sound |
( |
const std::string & |
fileName | ) |
|
|
inline |
Loads a sound from the given file.
- Exceptions
-
Definition at line 45 of file Sound.hpp.
References Load().
◆ Sound() [5/5]
| raylib::Sound::Sound |
( |
const ::Wave & |
wave | ) |
|
|
inline |
Loads a sound from the given Wave.
- Exceptions
-
Definition at line 52 of file Sound.hpp.
References Load().
◆ ~Sound()
| raylib::Sound::~Sound |
( |
| ) |
|
|
inline |
◆ GetFrameCount()
| unsigned int raylib::Sound::GetFrameCount |
( |
| ) |
const |
|
inline |
Retrieves the frameCount value for the object.
- Returns
- The frameCount value of the object.
Definition at line 56 of file Sound.hpp.
◆ GetStream()
| ::AudioStream raylib::Sound::GetStream |
( |
| ) |
const |
|
inline |
Retrieves the stream value for the object.
- Returns
- The stream value of the object.
Definition at line 57 of file Sound.hpp.
References Unload().
◆ IsPlaying()
| bool raylib::Sound::IsPlaying |
( |
| ) |
const |
|
inline |
Check if a sound is currently playing.
Definition at line 134 of file Sound.hpp.
◆ IsValid()
| bool raylib::Sound::IsValid |
( |
| ) |
const |
|
inline |
Retrieve whether or not the Sound buffer is loaded.
- Returns
- True or false depending on whether the Sound buffer is loaded.
Definition at line 189 of file Sound.hpp.
Referenced by Load(), and Load().
◆ Load() [1/2]
| void raylib::Sound::Load |
( |
const ::Wave & |
wave | ) |
|
|
inline |
◆ Load() [2/2]
| void raylib::Sound::Load |
( |
const std::string & |
fileName | ) |
|
|
inline |
◆ operator=()
| Sound & raylib::Sound::operator= |
( |
Sound && |
other | ) |
|
|
inlinenoexcept |
◆ Pause()
| Sound & raylib::Sound::Pause |
( |
| ) |
|
|
inline |
◆ Play()
| Sound & raylib::Sound::Play |
( |
| ) |
|
|
inline |
◆ Resume()
| Sound & raylib::Sound::Resume |
( |
| ) |
|
|
inline |
Resume a paused sound.
Definition at line 126 of file Sound.hpp.
◆ set()
| void raylib::Sound::set |
( |
const ::Sound & |
sound | ) |
|
|
inlineprotected |
◆ SetPan()
| Sound & raylib::Sound::SetPan |
( |
float |
pan = 0.5f | ) |
|
|
inline |
Set pan for a sound (0.5 is center)
Definition at line 155 of file Sound.hpp.
◆ SetPitch()
| Sound & raylib::Sound::SetPitch |
( |
float |
pitch | ) |
|
|
inline |
Set pitch for a sound (1.0 is base level)
Definition at line 147 of file Sound.hpp.
◆ SetVolume()
| Sound & raylib::Sound::SetVolume |
( |
float |
volume | ) |
|
|
inline |
Set volume for a sound (1.0 is max level)
Definition at line 139 of file Sound.hpp.
◆ Stop()
| Sound & raylib::Sound::Stop |
( |
| ) |
|
|
inline |
Stop playing a sound.
Definition at line 110 of file Sound.hpp.
◆ Unload()
| void raylib::Sound::Unload |
( |
| ) |
|
|
inline |
◆ Update() [1/2]
| Sound & raylib::Sound::Update |
( |
const void * |
data | ) |
|
|
inline |
Update sound buffer with new data, assuming it's the same sample count.
Definition at line 83 of file Sound.hpp.
◆ Update() [2/2]
| Sound & raylib::Sound::Update |
( |
const void * |
data, |
|
|
int |
samplesCount |
|
) |
| |
|
inline |
Update sound buffer with new data.
Definition at line 75 of file Sound.hpp.