25 #ifndef RAYLIB_CPP_INCLUDE_WAVE_HPP_
26 #define RAYLIB_CPP_INCLUDE_WAVE_HPP_
30 #include "./raylib.hpp"
31 #include "./raylib-cpp-utils.hpp"
41 unsigned int SampleCount = 0,
42 unsigned int SampleRate = 0,
43 unsigned int SampleSize = 0,
44 unsigned int Channels = 0) {
45 sampleCount = SampleCount;
46 sampleRate = SampleRate;
47 sampleSize = SampleSize;
54 Wave(
const std::string& fileName) {
55 set(::LoadWave(fileName.c_str()));
61 Wave(
const std::string& fileType,
const unsigned char *fileData,
int dataSize) {
62 set(::LoadWaveFromMemory(fileType.c_str(), fileData, dataSize));
69 GETTERSETTER(
unsigned int, SampleCount, sampleCount)
70 GETTERSETTER(
unsigned int, SampleRate, sampleRate)
71 GETTERSETTER(
unsigned int, SampleSize, sampleSize)
72 GETTERSETTER(
unsigned int, Channels, channels)
73 GETTERSETTER(
void *, Data, data)
83 inline Wave&
Format(
int SampleRate,
int SampleSize,
int Channels = 2) {
84 ::WaveFormat(
this, SampleRate, SampleSize, Channels);
92 return ::WaveCopy(*
this);
98 inline Wave&
Crop(
int initSample,
int finalSample) {
99 ::WaveCrop(
this, initSample, finalSample);
107 return ::LoadWaveSamples(*
this);
114 ::UnloadWaveSamples(samples);
120 inline bool Export(
const std::string& fileName) {
122 return ::ExportWave(*
this, fileName.c_str());
130 return ::ExportWaveAsCode(*
this, fileName.c_str());
147 return ::LoadSoundFromWave(*
this);
153 inline operator ::Sound() {
165 inline void set(const ::Wave& wave) {
166 sampleCount = wave.sampleCount;
167 sampleRate = wave.sampleRate;
168 sampleSize = wave.sampleSize;
169 channels = wave.channels;
175 #endif // RAYLIB_CPP_INCLUDE_WAVE_HPP_