17#include "vorbis/codec.h"
29 size_t OggSound::Read (
void *ptr,
size_t size,
size_t nmemb,
void *datasource )
31 auto* ogg_sound =
static_cast<OggSound*
> ( datasource );
35 int OggSound::Seek (
void *datasource, ogg_int64_t offset,
int whence )
37 auto* ogg_sound =
static_cast<OggSound*
> ( datasource );
41 int OggSound::Close (
void *datasource )
43 auto* ogg_sound =
static_cast<OggSound*
> ( datasource );
47 long OggSound::Tell (
void *datasource )
49 auto* ogg_sound =
static_cast<OggSound*
> ( datasource );
54 const ov_callbacks OggSound::Callbacks
67 file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
68 file.open ( aFileName, std::ios::binary );
69 mData = std::vector<uint8_t> ( ( std::istreambuf_iterator<char> ( file ) ),
70 ( std::istreambuf_iterator<char>() ) );
OggSound(const std::string &aFileName)
Constructs an OggSound by loading from the specified file.
~OggSound() final
Destructor.
Abstract base class representing a decoded sound resource.
<- This is here just for the literals
bool DecodeOGG(Sound &aSound, size_t aBufferSize, const void *aBuffer)
Decodes OGG Vorbis audio data from a memory buffer into a Sound.