ScummVM API documentation
Audio::XA_ADPCMStream Class Reference
Inheritance diagram for Audio::XA_ADPCMStream:
Audio::ADPCMStream Audio::SeekableAudioStream Audio::RewindableAudioStream Audio::AudioStream

Public Member Functions

 XA_ADPCMStream (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
 
virtual bool endOfData () const
 
virtual int readBuffer (int16 *buffer, const int numSamples)
 
- Public Member Functions inherited from Audio::ADPCMStream
 ADPCMStream (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
 
virtual bool isStereo () const
 
virtual int getRate () const
 
virtual bool rewind ()
 
virtual bool seek (const Timestamp &where)
 
virtual Timestamp getLength () const
 
- Public Member Functions inherited from Audio::SeekableAudioStream
bool seek (uint32 where)
 
- Public Member Functions inherited from Audio::AudioStream
virtual bool endOfStream () const
 

Protected Member Functions

void decodeXA (const byte *src)
 
- Protected Member Functions inherited from Audio::ADPCMStream
virtual void reset ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Audio::SeekableAudioStream
static SeekableAudioStreamopenStreamFile (const Common::Path &basename)
 
- Static Public Attributes inherited from Audio::ADPCMStream
static const int16 _stepAdjustTable [16]
 
- Protected Attributes inherited from Audio::ADPCMStream
Common::DisposablePtr< Common::SeekableReadStream_stream
 
int32 _startpos
 
const int32 _endpos
 
const int _channels
 
const uint32 _blockAlign
 
uint32 _blockPos [2]
 
const int _rate
 
struct Audio::ADPCMStream::ADPCMStatus _status
 

Member Function Documentation

◆ endOfData()

virtual bool Audio::XA_ADPCMStream::endOfData ( ) const
inlinevirtual

Check whether end of data has been reached.

If this returns true, it indicates that at this time there is no data available in the stream. However, there might be more data in the future.

This is used by e.g. a rate converter to decide whether to keep on converting data or to stop.

Reimplemented from Audio::ADPCMStream.

◆ readBuffer()

virtual int Audio::XA_ADPCMStream::readBuffer ( int16 *  buffer,
const int  numSamples 
)
virtual

Fill the given buffer with up to numSamples samples.

Data must be in native endianness, 16 bits per sample, signed. For stereo stream, the buffer will be filled with interleaved left and right channel samples, starting with the left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo stream, you will get a total of two left channel and two right channel samples.

Returns
The actual number of samples read, or -1 if a critical error occurred.
Note
You must check whether the returned value is less than what you requested. This indicates that the stream is fully used up.

Implements Audio::AudioStream.


The documentation for this class was generated from the following file: