Murl::IAudioStream Interface Referenceabstract

The audio stream interface. More...

#include "murl_i_audio_stream.h"

Inherited by Murl::Resource::AudioStream.

Public Member Functions

virtual ~IAudioStream ()
 The destructor.
 
virtual IAudioStreamClone () const =0
 Create a clone of the audio stream object. More...
 
virtual IAudioStreamClone (IEnums::SampleFormat sampleFormat) const =0
 Create a clone of the audio with a specified sample format. More...
 
virtual UInt32 GetNumberOfSamples () const =0
 Get the total number of decoded samples in the stream. More...
 
virtual UInt32 GetSampleIndex (Double startTime) const =0
 Get the index of the sample at a given start time. More...
 
virtual Double GetStartTime (UInt32 sampleIndex) const =0
 Get the start time of a sample at a given index. More...
 
virtual Double GetSampleRate () const =0
 Get the sample rate, i.e. More...
 
virtual Double GetSampleDuration () const =0
 Get the duration of a single sample, i.e. More...
 
virtual Double GetTotalDuration () const =0
 Get the total duration of the stream, in seconds. More...
 
virtual IEnums::SampleFormat GetSampleFormat () const =0
 Get the sample format. More...
 
virtual UInt32 GetBytesPerSample () const =0
 Get the number of bytes per sample. More...
 
virtual UInt32 GetNumberOfBytes () const =0
 Get the total number of bytes for the fully decoded stream. More...
 
virtual Bool IsReadyForDecoding () const =0
 Check if the stream is ready to be decoded. More...
 
virtual Bool StartDecoding ()=0
 Start decoding the stream. More...
 
virtual Bool EndDecoding ()=0
 End decoding the stream. More...
 
virtual UInt32 Decode (Data &dstBuffer, IEnums::SampleFormat dstFormat, UInt32 firstSample, UInt32 numSamples)=0
 Decode the stream. More...
 
virtual Bool SetCurrentMode (IEnums::StreamMode mode)=0
 Set the stream's current access mode. More...
 
virtual const IEnums::StreamMode GetCurrentMode () const =0
 Get the stream's current access mode. More...
 
virtual Bool SetCurrentTimeOffset (Double timeOffset)=0
 Set the current time offset for subsequent PrepareDecodedData() calls. More...
 
virtual Double GetCurrentTimeOffset () const =0
 Get the current time offset. More...
 
virtual Bool PrepareDecodedData ()=0
 Prepare decoded data, creating the underlying sample storage if needed. More...
 
virtual Bool FinishDecodedData ()=0
 Finish decoded data after a call to PrepareDecodedData(). More...
 
virtual Bool ReleaseDecodedData ()=0
 Release decoded data. More...
 
virtual Double GetDecodedTimeOffset () const =0
 Get the time offset of the recently decoded data buffer. More...
 
virtual UInt64 GetDecodedSampleIndex () const =0
 Get the index of the first decoded sample in the recently decoded buffer. More...
 
virtual const ConstDataGetDecodedData ()=0
 Get the decoded data. More...
 
virtual const MutableDataLockDecodedData ()=0
 Lock the decoded data. More...
 
virtual Bool UnlockDecodedData ()=0
 Unlock the decoded data. More...
 

Detailed Description

The audio stream interface.

Member Function Documentation

◆ Clone() [1/2]

virtual IAudioStream* Murl::IAudioStream::Clone ( ) const
pure virtual

Create a clone of the audio stream object.

Returns
The new audio stream object.

Referenced by ~IAudioStream().

◆ Clone() [2/2]

virtual IAudioStream* Murl::IAudioStream::Clone ( IEnums::SampleFormat  sampleFormat) const
pure virtual

Create a clone of the audio with a specified sample format.

Parameters
sampleFormatThe sample format of the new audio object.
Returns
The new audio stream object or null if conversion is not available.

◆ GetNumberOfSamples()

virtual UInt32 Murl::IAudioStream::GetNumberOfSamples ( ) const
pure virtual

Get the total number of decoded samples in the stream.

Returns
The number of samples.

Referenced by ~IAudioStream().

◆ GetSampleIndex()

virtual UInt32 Murl::IAudioStream::GetSampleIndex ( Double  startTime) const
pure virtual

Get the index of the sample at a given start time.

Parameters
startTimeThe sample start time in seconds.
Returns
The sample index.

Referenced by ~IAudioStream().

◆ GetStartTime()

virtual Double Murl::IAudioStream::GetStartTime ( UInt32  sampleIndex) const
pure virtual

Get the start time of a sample at a given index.

Parameters
sampleIndexThe index of the sample to query.
Returns
The sample's start time.

Referenced by ~IAudioStream().

◆ GetSampleRate()

virtual Double Murl::IAudioStream::GetSampleRate ( ) const
pure virtual

Get the sample rate, i.e.

the number of samples per second

Returns
The number of samples per second.

Referenced by ~IAudioStream().

◆ GetSampleDuration()

virtual Double Murl::IAudioStream::GetSampleDuration ( ) const
pure virtual

Get the duration of a single sample, i.e.

the inverse sample rate.

Returns
The sample duration in seconds.

Referenced by ~IAudioStream().

◆ GetTotalDuration()

virtual Double Murl::IAudioStream::GetTotalDuration ( ) const
pure virtual

Get the total duration of the stream, in seconds.

Returns
The total duration.

Referenced by ~IAudioStream().

◆ GetSampleFormat()

virtual IEnums::SampleFormat Murl::IAudioStream::GetSampleFormat ( ) const
pure virtual

Get the sample format.

Returns
The sample format.

Referenced by ~IAudioStream().

◆ GetBytesPerSample()

virtual UInt32 Murl::IAudioStream::GetBytesPerSample ( ) const
pure virtual

Get the number of bytes per sample.

Returns
The number of bytes per sample.

Referenced by ~IAudioStream().

◆ GetNumberOfBytes()

virtual UInt32 Murl::IAudioStream::GetNumberOfBytes ( ) const
pure virtual

Get the total number of bytes for the fully decoded stream.

Returns
The number of bytes.

Referenced by ~IAudioStream().

◆ IsReadyForDecoding()

virtual Bool Murl::IAudioStream::IsReadyForDecoding ( ) const
pure virtual

Check if the stream is ready to be decoded.

Returns
true if ready.

Referenced by ~IAudioStream().

◆ StartDecoding()

virtual Bool Murl::IAudioStream::StartDecoding ( )
pure virtual

Start decoding the stream.

Has to be called before Decode().

Returns
true if successful.

Referenced by ~IAudioStream().

◆ EndDecoding()

virtual Bool Murl::IAudioStream::EndDecoding ( )
pure virtual

End decoding the stream.

Has to be called after Decode().

Returns
true if successful.

Referenced by ~IAudioStream().

◆ Decode()

virtual UInt32 Murl::IAudioStream::Decode ( Data dstBuffer,
IEnums::SampleFormat  dstFormat,
UInt32  firstSample,
UInt32  numSamples 
)
pure virtual

Decode the stream.

StartDecoding() has to be called before, see also EndDecoding().

Parameters
dstBufferThe destination data.
dstFormatThe destination sample format.
firstSampleThe sample number to start from.
numSamplesThe number of samples to decode.
Returns
The number of decoded samples.

Referenced by ~IAudioStream().

◆ SetCurrentMode()

virtual Bool Murl::IAudioStream::SetCurrentMode ( IEnums::StreamMode  mode)
pure virtual

Set the stream's current access mode.

This serves as a hint to a possible underlying stream decoder, to be able to do optimal decoding whether single sample access or a continuous sequence of audio data is desired.

Parameters
modeThe access mode to apply.
Returns
true if successful.

Referenced by ~IAudioStream().

◆ GetCurrentMode()

virtual const IEnums::StreamMode Murl::IAudioStream::GetCurrentMode ( ) const
pure virtual

Get the stream's current access mode.

Returns
The current access mode.

Referenced by ~IAudioStream().

◆ SetCurrentTimeOffset()

virtual Bool Murl::IAudioStream::SetCurrentTimeOffset ( Double  timeOffset)
pure virtual

Set the current time offset for subsequent PrepareDecodedData() calls.

Parameters
timeOffsetThe time offset in seconds.
Returns
true if successful.

Referenced by ~IAudioStream().

◆ GetCurrentTimeOffset()

virtual Double Murl::IAudioStream::GetCurrentTimeOffset ( ) const
pure virtual

Get the current time offset.

Returns
The time offset in seconds.

Referenced by ~IAudioStream().

◆ PrepareDecodedData()

virtual Bool Murl::IAudioStream::PrepareDecodedData ( )
pure virtual

Prepare decoded data, creating the underlying sample storage if needed.

Decode the entire stream, see GetDecodedData().

Returns
true if successful.

Referenced by ~IAudioStream().

◆ FinishDecodedData()

virtual Bool Murl::IAudioStream::FinishDecodedData ( )
pure virtual

Finish decoded data after a call to PrepareDecodedData().

If the stream supports re-creating its contents on its own, it may also free its underlying sample storage to save memory.

Returns
true if successful.

Referenced by ~IAudioStream().

◆ ReleaseDecodedData()

virtual Bool Murl::IAudioStream::ReleaseDecodedData ( )
pure virtual

Release decoded data.

If the stream supports re-creating its contents on its own, it may free any underlying sample storage to save memory on this call, otherwise this may be a no-op.

Returns
true if successful.

Referenced by ~IAudioStream().

◆ GetDecodedTimeOffset()

virtual Double Murl::IAudioStream::GetDecodedTimeOffset ( ) const
pure virtual

Get the time offset of the recently decoded data buffer.

Returns
The time offset in seconds.

Referenced by ~IAudioStream().

◆ GetDecodedSampleIndex()

virtual UInt64 Murl::IAudioStream::GetDecodedSampleIndex ( ) const
pure virtual

Get the index of the first decoded sample in the recently decoded buffer.

Returns
The sample index.

Referenced by ~IAudioStream().

◆ GetDecodedData()

virtual const ConstData& Murl::IAudioStream::GetDecodedData ( )
pure virtual

Get the decoded data.

PrepareDecodedData() has to be called before, see also FinishDecodedData().

Returns
The decoded data or empty data if not supported.

Referenced by ~IAudioStream().

◆ LockDecodedData()

virtual const MutableData& Murl::IAudioStream::LockDecodedData ( )
pure virtual

Lock the decoded data.

Returns
The mutable data or empty data if not supported.

Referenced by ~IAudioStream().

◆ UnlockDecodedData()

virtual Bool Murl::IAudioStream::UnlockDecodedData ( )
pure virtual

Unlock the decoded data.

Returns
true if successful.

Referenced by ~IAudioStream().


The documentation for this interface was generated from the following file:
  • murl_i_audio_stream.h


Copyright © 2011-2018 Spraylight GmbH.