22VorbisAudioStream::VorbisAudioStream(
const string&
id,
const string& pathName,
const string& fileName) :
AudioStream(id)
39 Console::println(
string(
"VorbisAudioStream::rewind(): '"+ (
id) +
"': " + fse.what()));
41 Console::println(
string(
"VorbisAudioStream::rewind(): '" + (
id) +
"': " + ade.what()));
58 "VorbisAudioStream::initialize(): '" +
62 " bits per sample, " +
72 Console::println(
string(
"VorbisAudioStream::initialize(): '" + (
id) +
"': " + fse.what()));
77 Console::println(
string(
"VorbisAudioStream::initialize(): '" + (
id) +
"': " + ade.what()));
100 auto bytesDecoded = 0;
103 if (
looping ==
true && bytesDecoded < data->getCapacity()) {
107 Console::println(
string(
"Audio stream: '" + (
id) +
"': " + fse.what()));
109 Console::println(
string(
"Audio stream: '" + (
id) +
"': " + ade.what()));
virtual void dispose() override
Dispose this entity from OpenAL.
virtual bool initialize() override
Initiates this OpenAL entity to OpenAl.
virtual void setParameters(uint32_t sampleRate, uint8_t channels, const uint32_t bufferSize=32768)
Set audio initialization parameters.
void rewind() override
Rewinds this audio entity.
void dispose() override
Dispose this entity from OpenAL.
bool initialize() override
Initiates this OpenAL entity to OpenAl.
void fillBuffer(ByteBuffer *data) override
Fill buffer.
virtual ~VorbisAudioStream()
Destructor.
int32_t getBitsPerSample()
OGG/Vorbis audio decoder.
virtual void openFile(const string &pathName, const string &fileName)
Open a local file.
virtual void close()
Closes the audio file.
virtual void reset()
Resets this audio decoder, if a stream was open it will be rewinded.
virtual int32_t readFromStream(ByteBuffer *data)
Read raw PCM data from stream.