 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_SOUND_HPP_
26 #define RAYLIB_CPP_INCLUDE_SOUND_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
43 Sound(
const std::string& fileName) {
44 set(LoadSound(fileName.c_str()));
48 set(LoadSoundFromWave(wave));
55 GETTERSETTER(
unsigned int, SampleCount, sampleCount)
67 ::UpdateSound(*
this, data, sampleCount);
106 ::ResumeSound(*
this);
114 ::PlaySoundMulti(*
this);
130 return ::IsSoundPlaying(*
this);
137 ::SetSoundVolume(*
this, volume);
145 ::SetSoundPitch(*
this, pitch);
150 inline void set(const ::Sound& sound) {
151 sampleCount = sound.sampleCount;
152 stream = sound.stream;
157 #endif // RAYLIB_CPP_INCLUDE_SOUND_HPP_
Provides all the classes associated with raylib-cpp.
Sound & Update(const void *data, int sampleCount)
Update sound buffer with new data.
void set(const ::Sound &sound)
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(const ::Sound &vec)
Sound & Stop()
Stop playing a sound.
bool IsPlaying() const
Check if a sound is currently playing.
void Unload()
Unload sound.
AudioStream management functions.
Sound(const ::Wave &wave)
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)
Sound(const std::string &fileName)