mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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
Notes:
sideshowbarker
2024-07-17 18:13:20 +09:00
Author: https://github.com/standardexe
Commit: 7223b593cb
Pull-request: https://github.com/SerenityOS/serenity/pull/12749
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