mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:48:11 +00:00
Ladybird+LibWeb+WebContent: Create a platform plugin for playing audio
This creates (and installs upon WebContent startup) a platform plugin to play audio data. On Serenity, we use AudioServer to play audio over IPC. Unfortunately, AudioServer is currently coupled with Serenity's audio devices, and thus cannot be used in Ladybird on Lagom. Instead, we use a Qt audio device to play the audio, which requires the Qt multimedia package. While we use Qt to play the audio, note that we can still use LibAudio to decode the audio data and retrieve samples - we simply send Qt the raw PCM signals.
This commit is contained in:
parent
ee48d7514f
commit
a34e369252
15 changed files with 317 additions and 9 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "../AudioCodecPluginLadybird.h"
|
||||
#include "../EventLoopImplementationQt.h"
|
||||
#include "../FontPluginQt.h"
|
||||
#include "../ImageCodecPluginLadybird.h"
|
||||
|
@ -57,6 +58,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
Web::Platform::EventLoopPlugin::install(*new Web::Platform::EventLoopPluginSerenity);
|
||||
Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPluginLadybird);
|
||||
|
||||
Web::Platform::AudioCodecPlugin::install_creation_hook([] {
|
||||
return Ladybird::AudioCodecPluginLadybird::create();
|
||||
});
|
||||
|
||||
Web::ResourceLoader::initialize(RequestManagerQt::create());
|
||||
Web::WebSockets::WebSocketClientManager::initialize(Ladybird::WebSocketClientManagerLadybird::create());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue