The audio stream interface. More...
#include "murl_i_audio_stream.h"
Inherited by Murl::Resource::AudioStream.
Public Member Functions | |
virtual | ~IAudioStream () |
The destructor. | |
virtual IAudioStream * | Clone () const =0 |
Create a clone of the audio stream object. More... | |
virtual IAudioStream * | Clone (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 ConstData & | GetDecodedData ()=0 |
Get the decoded data. More... | |
virtual const MutableData & | LockDecodedData ()=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]
|
pure virtual |
Create a clone of the audio stream object.
- Returns
- The new audio stream object.
◆ Clone() [2/2]
|
pure virtual |
Create a clone of the audio with a specified sample format.
- Parameters
-
sampleFormat The sample format of the new audio object.
- Returns
- The new audio stream object or null if conversion is not available.
◆ GetNumberOfSamples()
|
pure virtual |
Get the total number of decoded samples in the stream.
- Returns
- The number of samples.
◆ GetSampleIndex()
Get the index of the sample at a given start time.
- Parameters
-
startTime The sample start time in seconds.
- Returns
- The sample index.
◆ GetStartTime()
Get the start time of a sample at a given index.
- Parameters
-
sampleIndex The index of the sample to query.
- Returns
- The sample's start time.
◆ GetSampleRate()
|
pure virtual |
Get the sample rate, i.e.
the number of samples per second
- Returns
- The number of samples per second.
◆ GetSampleDuration()
|
pure virtual |
Get the duration of a single sample, i.e.
the inverse sample rate.
- Returns
- The sample duration in seconds.
◆ GetTotalDuration()
|
pure virtual |
Get the total duration of the stream, in seconds.
- Returns
- The total duration.
◆ GetSampleFormat()
|
pure virtual |
Get the sample format.
- Returns
- The sample format.
◆ GetBytesPerSample()
|
pure virtual |
Get the number of bytes per sample.
- Returns
- The number of bytes per sample.
◆ GetNumberOfBytes()
|
pure virtual |
Get the total number of bytes for the fully decoded stream.
- Returns
- The number of bytes.
◆ IsReadyForDecoding()
|
pure virtual |
Check if the stream is ready to be decoded.
- Returns
- true if ready.
◆ StartDecoding()
|
pure virtual |
◆ EndDecoding()
|
pure virtual |
◆ Decode()
|
pure virtual |
Decode the stream.
StartDecoding() has to be called before, see also EndDecoding().
- Parameters
-
dstBuffer The destination data. dstFormat The destination sample format. firstSample The sample number to start from. numSamples The number of samples to decode.
- Returns
- The number of decoded samples.
◆ SetCurrentMode()
|
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
-
mode The access mode to apply.
- Returns
- true if successful.
◆ GetCurrentMode()
|
pure virtual |
Get the stream's current access mode.
- Returns
- The current access mode.
◆ SetCurrentTimeOffset()
Set the current time offset for subsequent PrepareDecodedData() calls.
- Parameters
-
timeOffset The time offset in seconds.
- Returns
- true if successful.
◆ GetCurrentTimeOffset()
|
pure virtual |
Get the current time offset.
- Returns
- The time offset in seconds.
◆ PrepareDecodedData()
|
pure virtual |
Prepare decoded data, creating the underlying sample storage if needed.
Decode the entire stream, see GetDecodedData().
- Returns
- true if successful.
◆ 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.
◆ 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.
◆ GetDecodedTimeOffset()
|
pure virtual |
Get the time offset of the recently decoded data buffer.
- Returns
- The time offset in seconds.
◆ GetDecodedSampleIndex()
|
pure virtual |
Get the index of the first decoded sample in the recently decoded buffer.
- Returns
- The sample index.
◆ 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.
◆ LockDecodedData()
|
pure virtual |
Lock the decoded data.
- Returns
- The mutable data or empty data if not supported.
◆ UnlockDecodedData()
|
pure virtual |
Unlock the decoded data.
- Returns
- true if successful.
The documentation for this interface was generated from the following file:
- murl_i_audio_stream.h