mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibWeb: Initialize AudioBufferSourceNode with correct defaults
This commit is contained in:
committed by
Tim Ledbetter
parent
9370990ff2
commit
a6ab9cc983
Notes:
github-actions[bot]
2025-01-08 14:46:56 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a6ab9cc983d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3128
@@ -129,6 +129,17 @@ WebIDL::ExceptionOr<GC::Ref<AudioBufferSourceNode>> AudioBufferSourceNode::const
|
||||
// MUST initialize the AudioNode this, with context and options as arguments.
|
||||
|
||||
auto node = realm.create<AudioBufferSourceNode>(realm, context, options);
|
||||
|
||||
// Default options for channel count and interpretation
|
||||
// https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
|
||||
AudioNodeDefaultOptions default_options;
|
||||
default_options.channel_count = 2;
|
||||
default_options.channel_count_mode = Bindings::ChannelCountMode::Max;
|
||||
default_options.channel_interpretation = Bindings::ChannelInterpretation::Speakers;
|
||||
// FIXME: Set tail-time to no
|
||||
|
||||
TRY(node->initialize_audio_node_options(options, default_options));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user