LibWeb: Implement BaseAudioContext.createBuffer

This is a simple factory function which effectively just calls the
AudioBuffer constructor.
This commit is contained in:
Shannon Booth 2024-05-26 11:56:11 +12:00 committed by Andreas Kling
commit 71ccd8ad25
Notes: sideshowbarker 2024-07-17 06:35:16 +09:00
6 changed files with 19 additions and 1 deletions

View file

@ -18,6 +18,11 @@ namespace Web::WebAudio {
JS_DEFINE_ALLOCATOR(AudioBuffer);
WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBuffer>> AudioBuffer::create(JS::Realm& realm, WebIDL::UnsignedLong number_of_channels, WebIDL::UnsignedLong length, float sample_rate)
{
return construct_impl(realm, { number_of_channels, length, sample_rate });
}
WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBuffer>> AudioBuffer::construct_impl(JS::Realm& realm, AudioBufferOptions const& options)
{
auto& vm = realm.vm();