Platform-agnostic Tremor (integer OGG) decoder. More...
#include <GuiSoundOggPlayer.h>
Public Member Functions | |
| bool | play (const uint8_t *data, int32_t length, int time_pos, bool loop) |
| Starts decoding data on a new thread. | |
| void | stop () |
| Stops playback and joins the decode thread. | |
| void | pause (bool pause) |
| Pauses or resumes the decode thread without stopping it. | |
| bool | isPlaying () const |
| bool | isPaused () const |
| int | getSampleRate () const |
| int | getChannels () const |
| const uint8_t * | getReadyBuffer (int32_t *outSize) |
| void | consumeBuffer () |
| Releases the buffer last returned by getReadyBuffer(), letting the decode thread reuse that ring slot. | |
Platform-agnostic Tremor (integer OGG) decoder.
Decodes into a small double-buffered PCM ring on its own decode thread; the platform AudioDriver that owns an instance is responsible for pulling ready buffers and feeding them to hardware - this class does no audio output itself.
Definition at line 17 of file GuiSoundOggPlayer.h.
| GuiSoundOggPlayer::GuiSoundOggPlayer | ( | ) |
Definition at line 17 of file GuiSoundOggPlayer.cpp.
| GuiSoundOggPlayer::~GuiSoundOggPlayer | ( | ) |
Definition at line 26 of file GuiSoundOggPlayer.cpp.
| void GuiSoundOggPlayer::consumeBuffer | ( | ) |
Releases the buffer last returned by getReadyBuffer(), letting the decode thread reuse that ring slot.
Definition at line 125 of file GuiSoundOggPlayer.cpp.
|
inline |
Definition at line 51 of file GuiSoundOggPlayer.h.
| const uint8_t * GuiSoundOggPlayer::getReadyBuffer | ( | int32_t * | outSize | ) |
| outSize | Filled with the ready buffer's size in bytes |
Definition at line 117 of file GuiSoundOggPlayer.cpp.
|
inline |
Definition at line 47 of file GuiSoundOggPlayer.h.
|
inline |
Definition at line 43 of file GuiSoundOggPlayer.h.
|
inline |
Definition at line 39 of file GuiSoundOggPlayer.h.
| void GuiSoundOggPlayer::pause | ( | bool | pause | ) |
Pauses or resumes the decode thread without stopping it.
Definition at line 113 of file GuiSoundOggPlayer.cpp.
| bool GuiSoundOggPlayer::play | ( | const uint8_t * | data, |
| int32_t | length, | ||
| int | time_pos, | ||
| bool | loop ) |
Starts decoding data on a new thread.
Any previous playback is stopped first.
| data | OGG file data. Must remain valid until stop() returns or playback finishes (the decode thread reads it directly). |
| length | Length of data in bytes |
| time_pos | Initial seek position, in milliseconds |
| loop | Whether to seek back to the start and keep decoding after reaching the end of the stream |
Definition at line 59 of file GuiSoundOggPlayer.cpp.
| void GuiSoundOggPlayer::stop | ( | ) |
Stops playback and joins the decode thread.
Definition at line 98 of file GuiSoundOggPlayer.cpp.