libSDL2pp
C++ bindings/wrapper for SDL2
|
Chunk of audio data read from a .WAV file More...
#include <SDL2pp/Wav.hh>
Public Member Functions | |
Wav (const std::string &file) | |
Load audio from file on disk. | |
Wav (RWops &rwops) | |
Load audio using RWops. | |
~Wav () | |
Destructor. | |
Wav (Wav &&other) noexcept | |
Move constructor. | |
Wav & | operator= (Wav &&other) noexcept |
Move assignment operator. | |
Wav (const Wav &other)=delete | |
Deleted copy constructor. | |
Wav & | operator= (const Wav &other)=delete |
Deleted assignment operator. | |
Uint32 | GetLength () const |
Get length of audio data. | |
Uint8 * | GetBuffer () |
Get pointer to raw audio data. | |
const Uint8 * | GetBuffer () const |
Get constant pointer to raw audio data. | |
const AudioSpec & | GetSpec () const |
Get descriptor of audio format. | |
Chunk of audio data read from a .WAV file
SDL2pp::Wav is a wrapper around basic SDL2 audio fragment handling functionality, basically SDL_LoadWAV() and related functions.
The class holds raw audio data which is loaded from a disk file or from an arbitrary source with SDL2pp::RWops and may be used in audio playback.
See audio_wav demo for an example.
|
explicit |
|
explicit |
Load audio using RWops.
[in] | rwops | SDL2pp::RWops used to access wav data |
SDL2pp::Exception |
SDL2pp::Wav::~Wav | ( | ) |
Destructor.
|
noexcept |
Move constructor.
[in] | other | SDL2pp::Wav object to move data from |
|
delete |
Deleted copy constructor.
This class is not copyable
Uint8 * SDL2pp::Wav::GetBuffer | ( | ) |
Get pointer to raw audio data.
const Uint8 * SDL2pp::Wav::GetBuffer | ( | ) | const |
Get constant pointer to raw audio data.
Uint32 SDL2pp::Wav::GetLength | ( | ) | const |
Get length of audio data.
const AudioSpec & SDL2pp::Wav::GetSpec | ( | ) | const |
Get descriptor of audio format.
Deleted assignment operator.
This class is not copyable
Move assignment operator.
[in] | other | SDL2pp::Wav object to move data from |