1 #ifndef RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_
2 #define RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_
4 #include "./raylib.hpp"
5 #include "./raylib-cpp-utils.hpp"
6 #include "./RaylibException.hpp"
19 unsigned int sampleRate = 0,
20 unsigned int sampleSize = 0,
21 unsigned int channels = 0) :
::AudioStream{buffer, sampleRate, sampleSize, channels} {
30 AudioStream(
unsigned int SampleRate,
unsigned int SampleSize,
unsigned int Channels = 2) {
31 if (!
Load(SampleRate, SampleSize, Channels)) {
41 other.buffer =
nullptr;
51 GETTERSETTER(rAudioBuffer *, Buffer, buffer)
52 GETTERSETTER(
unsigned int, SampleRate, sampleRate)
53 GETTERSETTER(
unsigned int, SampleSize, sampleSize)
54 GETTERSETTER(
unsigned int, Channels, channels)
71 other.buffer =
nullptr;
83 ::UpdateAudioStream(*
this, data, samplesCount);
91 ::UnloadAudioStream(*
this);
98 return ::IsAudioStreamProcessed(*
this);
105 ::PlayAudioStream(*
this);
113 ::PauseAudioStream(*
this);
121 ::ResumeAudioStream(*
this);
129 return ::IsAudioStreamPlaying(*
this);
136 ::StopAudioStream(*
this);
144 ::SetAudioStreamVolume(*
this, volume);
152 ::SetAudioStreamPitch(*
this, pitch);
160 ::SetAudioStreamBufferSizeDefault(size);
175 bool Load(
unsigned int SampleRate,
unsigned int SampleSize,
unsigned int Channels = 2) {
176 set(::LoadAudioStream(SampleRate, SampleSize, Channels));
181 inline void set(const ::AudioStream& stream) {
182 buffer = stream.buffer;
183 sampleRate = stream.sampleRate;
184 sampleSize = stream.sampleSize;
185 channels = stream.channels;
190 #endif // RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_