/
Mr.Stalin
/
FreeFT
Обзор
Документация
Войти
/
Mr.Stalin
/
FreeFT
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/audio/mp3_decoder.h
33 строки
768 B
Krzysztof Jakubowski
Formatted code to new style
25 фев 2024, 00:49
25 фев 2024, 00:49
ad441de
Код
Авторство
О чём код?
// Copyright (C) Krzysztof Jakubowski <nadult@fastmail.fm> // This file is part of FreeFT. See license.txt for details. #pragma once #include "base.h" #include <fwk/audio_base.h> namespace audio { class MP3Decoder { public: MP3Decoder(const string &file_name); ~MP3Decoder(); MP3Decoder(const MP3Decoder &) = delete; void operator=(const MP3Decoder &) = delete; bool decode(fwk::Sound &out, int max_size); bool isFinished() const { return m_is_finished; } int bytesPerSecond() const; //TODO: preloading data? (to avoid reading from disk while playing) //alternative: move audio device to separate thread private: Dynamic<FileStream> m_stream; void *m_handle = nullptr; int m_sample_rate, m_num_channels; bool m_is_finished, m_need_data; }; }