bool LoopingAudioStream::endOfData() const { if (!_stream) return true; if (_loop) return false; return _stream->endOfData(); }
void AppendableSnd::queueBuffer(Common::SeekableReadStream *bufferIn) { assert (_as); // Setup the ADPCM decoder uint32 sizeIn = bufferIn->size(); Audio::AudioStream *adpcm = makeDecoder(bufferIn, sizeIn); // Setup the output buffer uint32 sizeOut = sizeIn * 2; byte *bufferOut = new byte[sizeOut * 2]; // Decode to raw samples sizeOut = adpcm->readBuffer((int16 *)bufferOut, sizeOut); assert (adpcm->endOfData()); delete adpcm; // Queue the decoded samples _as->queueBuffer(bufferOut, sizeOut * 2); }
bool VideoDecoder::AudioTrack::endOfTrack() const { Audio::AudioStream *stream = getAudioStream(); return !stream || !g_system->getMixer()->isSoundHandleActive(_handle) || stream->endOfData(); }
bool endOfData() const { return _stream->endOfData(); }