![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The audio stream interface.
Create a clone of the audio stream object.
Murl.IAudioStream Clone()
Create a clone of the audio with a specified sample format.
Murl.IAudioStream Clone(Murl.IEnums.SampleFormat sampleFormat)
sampleFormat | The sample format of the new audio object. |
Get the total number of decoded samples in the stream.
Integer GetNumberOfSamples()
Get the index of the sample at a given start time.
Integer GetSampleIndex(Number startTime)
startTime | The sample start time in seconds. |
Get the start time of a sample at a given index.
Number GetStartTime(Integer sampleIndex)
sampleIndex | The index of the sample to query. |
Get the sample rate, i.e. the number of samples per second
Number GetSampleRate()
Get the duration of a single sample, i.e. the inverse sample rate.
Number GetSampleDuration()
Get the total duration of the stream, in seconds.
Number GetTotalDuration()
Get the sample format.
Murl.IEnums.SampleFormat GetSampleFormat()
Get the number of bytes per sample.
Integer GetBytesPerSample()
Get the total number of bytes for the fully decoded stream.
Integer GetNumberOfBytes()
Check if the stream is ready to be decoded.
Boolean IsReadyForDecoding()
Start decoding the stream. Has to be called before Decode().
Boolean StartDecoding()
End decoding the stream. Has to be called after Decode().
Boolean EndDecoding()
Decode the stream. StartDecoding() has to be called before, see also EndDecoding().
Integer, Murl.Data Decode(Murl.Data dstBuffer, Murl.IEnums.SampleFormat dstFormat, Integer firstSample, Integer numSamples)
dstBuffer | The destination data. |
dstFormat | The destination sample format. |
firstSample | The sample number to start from. |
numSamples | The number of samples to decode. |
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.
Boolean SetCurrentMode(Murl.IEnums.StreamMode mode)
mode | The access mode to apply. |
Get the stream's current access mode.
Murl.IEnums.StreamMode GetCurrentMode()
Set the current time offset for subsequent PrepareDecodedData() calls.
Boolean SetCurrentTimeOffset(Number timeOffset)
timeOffset | The time offset in seconds. |
Get the current time offset.
Number GetCurrentTimeOffset()
Prepare decoded data, creating the underlying sample storage if needed. Decode the entire stream, see GetDecodedData().
Boolean PrepareDecodedData()
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.
Boolean FinishDecodedData()
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.
Boolean ReleaseDecodedData()
Get the time offset of the recently decoded data buffer.
Number GetDecodedTimeOffset()
Get the index of the first decoded sample in the recently decoded buffer.
Integer GetDecodedSampleIndex()
Get the decoded data. PrepareDecodedData() has to be called before, see also FinishDecodedData().
Murl.ConstData GetDecodedData()
Lock the decoded data.
Murl.MutableData LockDecodedData()
Unlock the decoded data.
Boolean UnlockDecodedData()