10 #ifndef PLAYD_AUDIO_SOURCE_MP3_HPP 11 #define PLAYD_AUDIO_SOURCE_MP3_HPP 22 #include "../audio_source.hpp" 23 #include "../sample_formats.hpp" 34 Mp3AudioSource(
const std::string &path);
39 DecodeResult
Decode()
override;
40 std::uint64_t
Seek(std::uint64_t position)
override;
48 static const size_t BUFFER_SIZE;
50 std::vector<std::uint8_t> buffer;
53 mpg123_handle *context;
59 void AddFormat(
long rate);
63 #endif // PLAYD_AUDIO_SOURCE_MP3_HPP virtual DecodeResult Decode()=0
Performs a round of decoding.
An object responsible for decoding an audio file.
virtual std::uint8_t ChannelCount() const =0
Returns the channel count.
virtual SampleFormat OutputSampleFormat() const =0
Returns the output sample format.
virtual std::uint64_t Seek(std::uint64_t position)=0
Seeks to the given position, in samples.
virtual std::uint32_t SampleRate() const =0
Returns the sample rate.