⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.
Axmol Engine 2.4.0-ce063c5
|
The class for decoding compressed audio file to PCM buffer. More...
#include <AudioDecoderMp3.h>
Inherits AudioDecoder.
Public Member Functions | |
bool | open (std::string_view path) override |
Opens an audio file specified by a file path. | |
void | close () override |
Closes opened audio file. | |
uint32_t | read (uint32_t framesToRead, char *pcmBuf) override |
Reads audio frames of PCM format. | |
bool | seek (uint32_t frameOffset) override |
Sets frame offest to be read. | |
![]() | |
virtual bool | isOpened () const |
Checks whether decoder has opened file successfully. | |
virtual uint32_t | readFixedFrames (uint32_t framesToRead, char *pcmBuf) |
Reads fixed audio frames of PCM format. | |
virtual uint32_t | getTotalFrames () const |
Gets total frames of current audio. | |
virtual uint32_t | framesToBytes (uint32_t frames) const |
The helper function for convert frames to bytes. | |
virtual uint32_t | bytesToFrames (uint32_t bytes) const |
The helper function for convert bytes to frames. | |
virtual uint32_t | getSampleRate () const |
Gets sample rate of current audio. | |
virtual uint32_t | getChannelCount () const |
Gets the channel count of current audio. | |
The class for decoding compressed audio file to PCM buffer.
|
overridevirtual |
Opens an audio file specified by a file path.
Implements AudioDecoder.
|
overridevirtual |
Closes opened audio file.
Implements AudioDecoder.
|
overridevirtual |
Reads audio frames of PCM format.
framesToRead | The number of frames excepted to be read. |
pcmBuf | The buffer to hold the frames to be read, its size should be >= |framesToRead| / samplesPerBlock * _bytesPerBlock. |
Implements AudioDecoder.
|
overridevirtual |
Sets frame offest to be read.
frameOffset | The frame offest to be set. |
Implements AudioDecoder.