![]() |
Murl Engine API
Version 2018.3
|
The audio stream interface. More...
#include <murl_i_audio_stream.h>
The audio stream interface.
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... | |
|
pure virtual |
Create a clone of the audio stream object.
|
pure virtual |
Create a clone of the audio with a specified sample format.
sampleFormat | The sample format of the new audio object. |
|
pure virtual |
Get the total number of decoded samples in the stream.
Get the index of the sample at a given start time.
startTime | The sample start time in seconds. |
Get the start time of a sample at a given index.
sampleIndex | The index of the sample to query. |
|
pure virtual |
Get the sample rate, i.e.
the number of samples per second
|
pure virtual |
Get the duration of a single sample, i.e.
the inverse sample rate.
|
pure virtual |
Get the total duration of the stream, in seconds.
|
pure virtual |
Get the sample format.
|
pure virtual |
Get the number of bytes per sample.
|
pure virtual |
Get the total number of bytes for the fully decoded stream.
|
pure virtual |
Check if the stream is ready to be decoded.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Decode the stream.
StartDecoding() has to be called before, see also EndDecoding().
dstBuffer | The destination data. |
dstFormat | The destination sample format. |
firstSample | The sample number to start from. |
numSamples | The number of samples to decode. |
|
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.
mode | The access mode to apply. |
|
pure virtual |
Get the stream's current access mode.
Set the current time offset for subsequent PrepareDecodedData() calls.
timeOffset | The time offset in seconds. |
|
pure virtual |
Get the current time offset.
|
pure virtual |
Prepare decoded data, creating the underlying sample storage if needed.
Decode the entire stream, see GetDecodedData().
|
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.
|
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.
|
pure virtual |
Get the time offset of the recently decoded data buffer.
|
pure virtual |
Get the index of the first decoded sample in the recently decoded buffer.
|
pure virtual |
Get the decoded data.
PrepareDecodedData() has to be called before, see also FinishDecodedData().
|
pure virtual |
Lock the decoded data.
|
pure virtual |
Unlock the decoded data.