18 #include <vorbis/vorbisfile.h>
32 using std::make_unique;
45 for (
size_t i = 0; i < size * count; i++) {
87 static ov_callbacks oggFileCallbacks = {
97 if (ov_open_callbacks(
oggFileData.get(), &
vf, NULL, 0, oggFileCallbacks) < 0) {
102 vorbis_info *vi = ov_info(&
vf, -1);
132 while (read < data->getCapacity()) {
138 #
if defined(__powerpc__) || defined(__powerpc64__)
OGG/Vorbis audio decoder.
static int oggfiledata_close(VorbisDecoder::OGGFileData *oggFileData)
Close OGG file data.
static int oggfiledata_seek(VorbisDecoder::OGGFileData *oggFileData, ogg_int64_t offset, int whence)
Seek in OGG file data.
unique_ptr< OGGFileData > oggFileData
void close() override
Closes the audio file.
int64_t readFromStream(ByteBuffer *data) override
Read raw PCM data from stream.
static size_t oggfiledata_read(void *buffer, size_t size, size_t count, VorbisDecoder::OGGFileData *oggFileData)
Read from OGG file data.
void reset() override
Resets this audio decoder, if a stream was open it will be rewinded.
void openFile(const string &pathName, const string &fileName) override
Open a local file.
static long oggfiledata_tell(VorbisDecoder::OGGFileData *oggFileData)
Tell position of OGG file data.
File system singleton class.
virtual Buffer * setPosition(int64_t position)
Set position.
const uint8_t * getBuffer() const
virtual int64_t getCapacity() const