Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IReader Interface Referenceabstract

This class represents a sound source as stream or as buffer which can be read for example by another reader, a device or whatever. More...

#include <IReader.h>

Inheritance diagram for IReader:
Inheritance graph
[legend]

Public Member Functions

virtual ~IReader ()
 Destroys the reader.
 
virtual bool isSeekable () const =0
 Tells whether the source provides seeking functionality or not.
 
virtual void seek (int position)=0
 Seeks to a specific position in the source.
 
virtual int getLength () const =0
 Returns an approximated length of the source in samples.
 
virtual int getPosition () const =0
 Returns the position of the source as a sample count value.
 
virtual Specs getSpecs () const =0
 Returns the specification of the reader.
 
virtual void read (int &length, bool &eos, sample_t *buffer)=0
 Request to read the next length samples out of the source.
 

Detailed Description

This class represents a sound source as stream or as buffer which can be read for example by another reader, a device or whatever.

Member Function Documentation

◆ getLength()

virtual int IReader::getLength ( ) const
pure virtual

◆ getPosition()

virtual int IReader::getPosition ( ) const
pure virtual

Returns the position of the source as a sample count value.

Returns
The current position in the source. A negative value indicates that the position is unknown.
Warning
The value returned doesn't always have to be correct for readers, especially after seeking.

Implemented in BinauralReader, ConvolverReader, DelayReader, EffectReader, LimiterReader, LoopReader, ModulatorReader, MutableReader, ReverseReader, VolumeReader, SawtoothReader, SilenceReader, SineReader, SquareReader, TriangleReader, JOSResampleReader, LinearResampleReader, DoubleReader, SequenceReader, SuperposeReader, BufferReader, FFMPEGReader, SndFileReader, and OpenALReader.

◆ getSpecs()

virtual Specs IReader::getSpecs ( ) const
pure virtual

◆ isSeekable()

virtual bool IReader::isSeekable ( ) const
pure virtual

Tells whether the source provides seeking functionality or not.

Warning
This doesn't mean that the seeking always has to succeed.
Returns
Always returns true for readers of buffering types.

Implemented in BinauralReader, ConvolverReader, EffectReader, ModulatorReader, MutableReader, VolumeReader, SawtoothReader, SilenceReader, SineReader, SquareReader, TriangleReader, DoubleReader, SequenceReader, SuperposeReader, BufferReader, FFMPEGReader, SndFileReader, and OpenALReader.

◆ read()

virtual void IReader::read ( int & length,
bool & eos,
sample_t * buffer )
pure virtual

Request to read the next length samples out of the source.

The buffer supplied has the needed size.

Parameters
[in,out]lengthThe count of samples that should be read. Shall contain the real count of samples after reading, in case there were only fewer samples available. A smaller value also indicates the end of the reader.
[out]eosEnd of stream, whether the end is reached or not.
[in]bufferThe pointer to the buffer to read into.

Implemented in ADSRReader, BaseIIRFilterReader, BinauralReader, ConvolverReader, DelayReader, EffectReader, FaderReader, LimiterReader, LoopReader, ModulatorReader, MutableReader, ReverseReader, VolumeReader, SawtoothReader, SilenceReader, SineReader, SquareReader, TriangleReader, ChannelMapperReader, ConverterReader, JOSResampleReader, LinearResampleReader, DoubleReader, SequenceReader, SuperposeReader, BufferReader, FFMPEGReader, SndFileReader, and OpenALReader.

◆ seek()

virtual void IReader::seek ( int position)
pure virtual

Seeks to a specific position in the source.

Parameters
positionThe position to seek for measured in samples. To get from a given time to the samples you simply have to multiply the time value in seconds with the sample rate of the reader.
Warning
This may work or not, depending on the actual reader.

Implemented in BinauralReader, ConvolverReader, DelayReader, EffectReader, LimiterReader, LoopReader, ModulatorReader, MutableReader, ReverseReader, VolumeReader, SawtoothReader, SilenceReader, SineReader, SquareReader, TriangleReader, JOSResampleReader, LinearResampleReader, DoubleReader, SequenceReader, SuperposeReader, BufferReader, FFMPEGReader, SndFileReader, and OpenALReader.


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