API for managing audio input streams.
|
AudioStream * | Audio::makeLoopingAudioStream (RewindableAudioStream *stream, uint loops) |
|
AudioStream * | Audio::makeLoopingAudioStream (SeekableAudioStream *stream, Timestamp start, Timestamp end, uint loops) |
|
QueuingAudioStream * | Audio::makeQueuingAudioStream (int rate, bool stereo) |
|
Timestamp | Audio::convertTimeToStreamPos (const Timestamp &where, int rate, bool isStereo) |
|
AudioStream * | Audio::makeLimitingAudioStream (AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES) |
|
AudioStream * | Audio::makeNullAudioStream () |
|
AudioStream * | Audio::makeSilentAudioStream (int rate, bool stereo) |
|
◆ makeLoopingAudioStream() [1/2]
Wrapper functionality to efficiently create a stream that might be looped.
This function does not return a LoopingAudioStream, because it does not create one when the loop count is "1". This allows to keep the runtime overhead down when the code does not require any functionality that is only offered by LoopingAudioStream.
- Parameters
-
stream | The stream to loop (will be automatically destroyed, when the looping is done). |
loops | How often to loop (0 = infinite). |
- Returns
- A new AudioStream that offers the desired functionality.
◆ makeLoopingAudioStream() [2/2]
Wrapper functionality to efficiently create a stream that might be looped in a certain interval.
This automatically starts the stream at time "start"!
This function does not return a LoopingAudioStream, because it does not create one when the loop count is "1". This allows to keep the runtime overhead down when the code does not require any functionality that is only offered by LoopingAudioStream.
- Parameters
-
stream | The stream to loop (will be automatically destroyed when the looping is done). |
start | Start time of the stream interval to be looped. |
end | End of the stream interval to be looped (a zero time means till the end). |
loops | How often to loop (0 = infinite). |
- Returns
- A new AudioStream that offers the desired functionality.
◆ makeQueuingAudioStream()
◆ convertTimeToStreamPos()
Timestamp Audio::convertTimeToStreamPos |
( |
const Timestamp & |
where, |
|
|
int |
rate, |
|
|
bool |
isStereo |
|
) |
| |
Convert a point in time to a precise sample offset with the given parameters.
- Parameters
-
where | Point in time. |
rate | Rate of the stream. |
isStereo | Whether the stream is a stereo stream. |
◆ makeLimitingAudioStream()
AudioStream* Audio::makeLimitingAudioStream |
( |
AudioStream * |
parentStream, |
|
|
const Timestamp & |
length, |
|
|
DisposeAfterUse::Flag |
disposeAfterUse = DisposeAfterUse::YES |
|
) |
| |
Factory function for an AudioStream wrapper that cuts off the amount of samples read after a given time length is reached.
- Parameters
-
parentStream | The stream to limit. |
length | The time length to limit the stream to. |
disposeAfterUse | Whether the parent stream object should be destroyed on destruction of the returned stream. |
◆ makeNullAudioStream()
Create an AudioStream that plays nothing and immediately returns that endOfStream() has been reached.
◆ makeSilentAudioStream()
AudioStream* Audio::makeSilentAudioStream |
( |
int |
rate, |
|
|
bool |
stereo |
|
) |
| |
Create an AudioStream that just returns silent samples and runs infinitely.