mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
SoundPlayer: Reduce sample buffer size and add a sample load event
This commit is contained in:
parent
7aa5297835
commit
f9e4bff487
Notes:
sideshowbarker
2024-07-18 21:02:49 +09:00
Author: https://github.com/ngc6302h
Commit: f9e4bff487
Pull-request: https://github.com/SerenityOS/serenity/pull/5878
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/RealKC
Reviewed-by: https://github.com/alimpfard
3 changed files with 10 additions and 3 deletions
|
@ -32,7 +32,7 @@
|
|||
#include <LibAudio/Loader.h>
|
||||
#include <LibCore/Timer.h>
|
||||
|
||||
#define PLAYBACK_MANAGER_BUFFER_SIZE 64 * KiB
|
||||
#define PLAYBACK_MANAGER_BUFFER_SIZE 48 * KiB
|
||||
#define PLAYBACK_MANAGER_RATE 44100
|
||||
|
||||
class PlaybackManager final {
|
||||
|
@ -56,6 +56,7 @@ public:
|
|||
NonnullRefPtr<Audio::ClientConnection> connection() const { return m_connection; }
|
||||
|
||||
Function<void()> on_update;
|
||||
Function<void(Audio::Buffer&)> on_load_sample_buffer;
|
||||
|
||||
private:
|
||||
void next_buffer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue