1 #ifndef RAYLIB_CPP_WAVE_HPP_
2 #define RAYLIB_CPP_WAVE_HPP_
12 #include "./raylib-cpp-utils.hpp"
21 Wave(
unsigned int SampleCount = 0,
unsigned int SampleRate = 0,
unsigned int SampleSize = 0,
unsigned int Channels = 0) {
22 sampleCount = SampleCount;
23 sampleRate = SampleRate;
24 sampleSize = SampleSize;
28 Wave(
const std::string& fileName) {
29 set(LoadWave(fileName.c_str()));
36 GETTERSETTER(
unsigned int, SampleCount, sampleCount)
37 GETTERSETTER(
unsigned int, SampleRate, sampleRate)
38 GETTERSETTER(
unsigned int, SampleSize, sampleSize)
39 GETTERSETTER(
unsigned int, Channels, channels)
40 GETTERSETTER(
void *, Data, data)
52 inline Wave&
Format(
int SampleRate = 0,
int SampleSize = 0,
int Channels = 2) {
53 ::WaveFormat(
this, SampleRate, SampleSize, Channels);
58 return ::WaveCopy(*
this);
61 inline Wave&
Crop(
int initSample,
int finalSample) {
62 ::WaveCrop(
this, initSample, finalSample);
67 ::ExportWave(*
this, fileName.c_str());
71 ::ExportWaveAsCode(*
this, fileName.c_str());
83 return ::LoadSoundFromWave(*
this);
87 return ::GetWaveData(*
this);
92 sampleCount = wave.sampleCount;
93 sampleRate = wave.sampleRate;
94 sampleSize = wave.sampleSize;
95 channels = wave.channels;