|
CeresEngine 0.2.0
A game development framework
|
A audio stream is a larger piece of audio that will be streammed for the device (instead of feeding all audio samples all at once). More...
#include <CeresEngine/Audio/AudioResource.hpp>
Public Types | |
| using | ReadSamplesCallback = std::function< void(AudioStream &, std::error_code, Samples &)> |
| A callback used as a reply for a read samples operation. | |
Public Types inherited from CeresEngine::AbstractAudioResource | |
| using | Sample = unsigned short |
| A audio sample type. | |
| using | Samples = Vector< Sample > |
| A collection of multiple audio samples. | |
| using | SampleIndex = unsigned int |
| A type representing the index of a sample. | |
| using | SampleOffset = int |
| A type representing a sample offset. | |
Public Member Functions | |
| virtual void | readSamples (unsigned int samples, ReadSamplesCallback &&callback)=0 |
Reads up to samples from the stream. | |
| virtual void | seek (SampleIndex index)=0 |
| Seeks the audio stream. | |
| AudioResourceType | getType () const final |
Public Member Functions inherited from CeresEngine::AbstractAudioResource | |
| virtual | ~AbstractAudioResource ()=default |
| virtual const AudioMetadata & | getMetadata () const =0 |
| bool | isClip () const |
| AudioClip & | asClip () |
| const AudioClip & | asClip () const |
| bool | isStream () const |
| AudioStream & | asStream () |
| const AudioStream & | asStream () const |
A audio stream is a larger piece of audio that will be streammed for the device (instead of feeding all audio samples all at once).
Audio streams are suitable for background music, VOIP data (which by nature is a stream) or any other larger audio track that is large and the implementer does not want to load it entirely on RAM.
| using CeresEngine::AudioStream::ReadSamplesCallback = std::function<void( AudioStream&, std::error_code, Samples&)> |
A callback used as a reply for a read samples operation.
|
finalvirtual |
Implements CeresEngine::AbstractAudioResource.
|
pure virtual |
Reads up to samples from the stream.
| samples | The maximum number of samples to be read |
| callback | The callback to be called after the operation has completed |
|
pure virtual |
Seeks the audio stream.
| index | The sample to seek the stream to |