 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
1 #ifndef RAYLIB_CPP_INCLUDE_SOUND_HPP_
2 #define RAYLIB_CPP_INCLUDE_SOUND_HPP_
6 #include "./raylib.hpp"
7 #include "./raylib-cpp-utils.hpp"
20 Sound(const ::Sound& vec) {
24 Sound(
const std::string& fileName) {
25 set(LoadSound(fileName.c_str()));
28 Sound(const ::Wave& wave) {
29 set(LoadSoundFromWave(wave));
36 GETTERSETTER(
unsigned int, SampleCount, sampleCount)
48 ::UpdateSound(*
this, data, sampleCount);
56 ::UpdateSound(*
this, data, sampleCount);
103 ::PlaySoundMulti(*
this);
119 return ::IsSoundPlaying(*
this);
126 ::SetSoundVolume(*
this, volume);
134 ::SetSoundPitch(*
this, pitch);
139 inline void set(const ::Sound& sound) {
140 sampleCount = sound.sampleCount;
141 stream = sound.stream;
146 #endif // RAYLIB_CPP_INCLUDE_SOUND_HPP_
All raylib-cpp classes and functions appear in the raylib namespace.
Sound & Update(const void *data, int sampleCount)
Update sound buffer with new data.
Sound & StopMulti()
Stop any sound playing (using multichannel buffer pool)
Sound & SetVolume(float volume)
Set volume for a sound (1.0 is max level)
Wave/Sound management functions.
Sound & Pause()
Pause a sound.
Sound & Resume()
Resume a paused sound.
Sound & Stop()
Stop playing a sound.
bool IsPlaying() const
Check if a sound is currently playing.
void Unload()
Unload sound.
AudioStream management functions.
Sound & Update(const void *data)
Update sound buffer with new data, assuming it's the same sample count.
Sound & SetPitch(float pitch)
Set pitch for a sound (1.0 is base level)
Sound & Play()
Play a sound.
Sound & PlayMulti()
Play a sound (using multichannel buffer pool)