IAudioPlayer#
Interface for audio playback.
Header: | #include <AUI/Audio/IAudioPlayer.h> |
CMake: | aui_link(my_target PUBLIC aui::audio) |
Detailed Description#
Experimental Feature
This API is experimental. Experimental APIs are likely to contain bugs, might be changed or removed in the future.
Public Types#
PlaybackStatus#
enum class IAudioPlayer::PlaybackStatus
Playback status depends on last called function among play(), pause(), stop().
Constant | Description |
---|---|
PlaybackStatus::PLAYING
|
|
PlaybackStatus::PAUSED
|
|
PlaybackStatus::STOPPED
|
Public fields and Signals#
finished#
emits<> finished
On playback finished.
read#
emits<> read
On sound stream read.
Public Methods#
loop#
- Returns
- Current loop flag
onFinished#
Called By AAudioMixer when the playback is finished.
See IAudioPlayer::finished for listening for this event.
pause#
Pauses audio playback keeping playback progress.
play#
Starts audio playback, if playback was previously paused, it will continue from where it was paused.
playbackStatus#
- Returns
- Current playback status.
resamplerStream#
Get resampled stream for playback.
setLoop#
Set loop flag, is loop flag is true then audio playback wouldn't be stopped after it ends and sound stream would be rewind.
- Arguments
loop
New loop flag
setVolume#
Set level of volume.
- Arguments
volume
Integer number from 0 to 256 inclusively, works linear
stop#
Pauses audio playback without keeping playback progress.
volume#
- Returns
- Current volume level.