mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibAudio: Add basic MP3 Decoder
This is a basic MPEG-1 layer 3 audio decoder. It supports all sample rates and stereo modes except for freeformat.
This commit is contained in:
parent
6a64aabce8
commit
7223b593cb
5 changed files with 1106 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <LibAudio/FlacLoader.h>
|
||||
#include <LibAudio/Loader.h>
|
||||
#include <LibAudio/MP3Loader.h>
|
||||
#include <LibAudio/WavLoader.h>
|
||||
|
||||
namespace Audio {
|
||||
|
@ -27,6 +28,11 @@ Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(StringView p
|
|||
if (!initstate1.is_error())
|
||||
return plugin;
|
||||
|
||||
plugin = adopt_own(*new MP3LoaderPlugin(path));
|
||||
auto initstate2 = plugin->initialize();
|
||||
if (!initstate2.is_error())
|
||||
return plugin;
|
||||
|
||||
return LoaderError { "No loader plugin available" };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue