MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Mezzanine::Audio::iDecoder Class Referenceabstract

This is an interface class for the decoding of audio from a stream. More...

#include <decoder.h>

Public Member Functions

 iDecoder ()
 Class constructor.
 
virtual ~iDecoder ()
 Class destructor.
 
virtual Audio::BitConfig GetBitConfiguration () const =0
 Gets the Bit Configuration used to decode the audio stream. More...
 
virtual UInt32 GetCompressedSize () const =0
 Gets the size of the encoded audio source in use. More...
 
virtual UInt32 GetCurrentCompressedPosition () const =0
 Gets the sounds current position in the encoded audio source. More...
 
virtual UInt32 GetCurrentPosition () const =0
 Gets the sounds current position in the decoded audio source. More...
 
virtual Real GetCurrentTime () const =0
 Gets the current time position in the stream. More...
 
virtual Audio::Encoding GetEncoding () const =0
 Gets the encoding supported by this decoder. More...
 
virtual UInt32 GetFrequency () const =0
 Gets the frequency used to decode the audio stream. More...
 
virtual UInt32 GetSampleSize () const
 Gets the sample size based on the decoders current configuration. More...
 
virtual Resource::DataStreamPtr GetStream () const =0
 Gets the stream being decoded. More...
 
virtual UInt32 GetTotalSize () const =0
 Gets the size of the decoded audio source in use. More...
 
virtual Real GetTotalTime () const =0
 Gets the length of the stream in seconds. More...
 
virtual bool IsSeekingSupported ()=0
 Gets whether or not seeking is supported. More...
 
virtual bool IsValid ()=0
 Gets whether or not the decoder is ready to be used. More...
 
virtual UInt32 ReadAudioData (void *Output, UInt32 Amount)=0
 Reads from the audio stream and writes what is read to a buffer. More...
 
virtual bool Seek (const Real Seconds, bool Relative)=0
 Moves the current time position in the stream. More...
 
virtual bool SetPosition (Int32 Position, bool Relative)=0
 Sets the position (in bytes) of the stream. More...
 

Detailed Description

This is an interface class for the decoding of audio from a stream.

Definition at line 59 of file decoder.h.

Member Function Documentation

virtual Audio::BitConfig Mezzanine::Audio::iDecoder::GetBitConfiguration ( ) const
pure virtual

Gets the Bit Configuration used to decode the audio stream.

Returns
Returns the Bit Configuration currently being used to decode this stream.
virtual UInt32 Mezzanine::Audio::iDecoder::GetCompressedSize ( ) const
pure virtual

Gets the size of the encoded audio source in use.

Returns
Returns the size of the encoded audio source.
virtual UInt32 Mezzanine::Audio::iDecoder::GetCurrentCompressedPosition ( ) const
pure virtual

Gets the sounds current position in the encoded audio source.

Returns
Returns the current position in the encoded audio source in bytes.
virtual UInt32 Mezzanine::Audio::iDecoder::GetCurrentPosition ( ) const
pure virtual

Gets the sounds current position in the decoded audio source.

Returns
Returns the current position in the decoded audio source in bytes.
virtual Real Mezzanine::Audio::iDecoder::GetCurrentTime ( ) const
pure virtual

Gets the current time position in the stream.

Returns
Returns the current position in the stream in seconds.
virtual Audio::Encoding Mezzanine::Audio::iDecoder::GetEncoding ( ) const
pure virtual

Gets the encoding supported by this decoder.

Returns
Returns an Audio::Encoding value representing the encoding supported by this decoder.
virtual UInt32 Mezzanine::Audio::iDecoder::GetFrequency ( ) const
pure virtual

Gets the frequency used to decode the audio stream.

Returns
Returns the frequency (or sample rate) currently being used to decode this stream.
virtual UInt32 Mezzanine::Audio::iDecoder::GetSampleSize ( ) const
inlinevirtual

Gets the sample size based on the decoders current configuration.

Returns
Returns a UInt32 representing the size of a single sample from the underlying stream.

Definition at line 92 of file decoder.h.

virtual Resource::DataStreamPtr Mezzanine::Audio::iDecoder::GetStream ( ) const
pure virtual

Gets the stream being decoded.

Returns
Returns a shared pointer to the DataStream being decoded.
virtual UInt32 Mezzanine::Audio::iDecoder::GetTotalSize ( ) const
pure virtual

Gets the size of the decoded audio source in use.

Returns
Returns the size of the decoded audio source.
virtual Real Mezzanine::Audio::iDecoder::GetTotalTime ( ) const
pure virtual

Gets the length of the stream in seconds.

Returns
Returns the total amount of time needed to playback the sound in seconds.
virtual bool Mezzanine::Audio::iDecoder::IsSeekingSupported ( )
pure virtual

Gets whether or not seeking is supported.

Returns
Returns true if you can skip to a specific point in the stream, false if you are stuck waiting.
virtual bool Mezzanine::Audio::iDecoder::IsValid ( )
pure virtual

Gets whether or not the decoder is ready to be used.

Note
On failure the issue likely lies with the stream being an improper format/encoding.
Returns
Returns true if this decoder is ready for playback, false otherwise.
virtual UInt32 Mezzanine::Audio::iDecoder::ReadAudioData ( void *  Output,
UInt32  Amount 
)
pure virtual

Reads from the audio stream and writes what is read to a buffer.

Parameters
OutputThe buffer to write to when reading the audio stream.
AmountThe number of bytes desired to be read from the audio stream.
Returns
Returns the number of bytes successfully read from the audio stream.
virtual bool Mezzanine::Audio::iDecoder::Seek ( const Real  Seconds,
bool  Relative 
)
pure virtual

Moves the current time position in the stream.

Parameters
SecondsThe position in seconds to move to in the stream.
RelativeWhether or not to move from the current position. If false this will seek from the beginning.
Returns
Returns true if the position was successfully moved, false otherwise.
virtual bool Mezzanine::Audio::iDecoder::SetPosition ( Int32  Position,
bool  Relative 
)
pure virtual

Sets the position (in bytes) of the stream.

Parameters
PositionThe number of bytes to move(if relative) or the actual position in the stream to set.
RelativeWhether or not to move from the current position. If false this will set from the beginning.
Returns
Returns true if the position was successfully set, false otherwise.

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