Commit Graph

22 Commits

Author SHA1 Message Date
Jelle Raaijmakers
35f4f5cf54 LibWeb: Implement AudioListener
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.

(cherry picked from commit 2a98f2a12d5069a2189fa38b4a7e158d84ee03ec)
2024-11-14 17:46:06 -05:00
Jelle Raaijmakers
ec6803eb44 LibWeb: Implement pending promises in BaseAudioContext
Move the pending promises list from AudioContext to BaseAudioContext and
deal with all remaining FIXMEs.

(cherry picked from commit 2df3488840ccf8e8c560bde4826897c2023dbe29)
2024-11-13 19:32:02 -05:00
Pavel Shliak
df40a0cf2c LibAudio: Initialize GainNode properly
That helps to pass WPT tests
under /webaudio/the-audio-api/the-gainnode-interface/ctor-gain.html

(cherry picked from commit 4998385c7aeae21939f4ea24bb4f8c6eb477840b)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
fb8870d710 LibWeb: Add barebones BaseAudioContext.decodeAudioData()
Implement just enough steps to get https://zty.pe/ working! :^)

(cherry picked from commit 14b2e5849d4b82aec6900253f6f035a9b356bad3)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
4e0c54fa61 LibWeb: Accept JS::HeapFunction when queuing a media element task
This opens up the possibility of easier memory management in future
changes.

(cherry picked from commit 7b76438d579959edd800de14cb30c57eadb14669)
2024-11-13 10:17:34 -05:00
Jelle Raaijmakers
b5f61be76a LibWeb: Move 'queue a media element task' to BaseAudioContext
We need these steps to be available for the yet to be implemented
`BaseAudioContext.decodeAudioData()`.

(cherry picked from commit 177e5210e09ee4b5906e5d7db34154fae4ec76c6)
2024-11-13 10:17:34 -05:00
bbb651
6c93feee99 WebAudio: Stub AudioDestinationContext
And expose it through `BaseAudioContext::destination`

(cherry picked from commit 779e3072f93369cf3adef0379bf27ea55475b38b)
2024-07-29 06:30:08 -04:00
Shannon Booth
0ce3726d49 WebAudio: Add stub for AudioDestinationNode.destination
This is called by https://athenacrisis.com/ and passed through to
AudioNode.connect, which expects an AudioNode.

Implement this function enough so that we return an AudioNode so that
AudioNode.connect does not throw a TypeError.

(cherry picked from commit a51095f705c5a6bce2c291e8b51ac90182c63419)
2024-07-28 20:21:18 -04:00
bbb651
a6ba31af93 WebAudio: Stub BiquadFilterNode
(cherry picked from commit 64663d53fa466dcb9b62becc352c92e3d932353b)
2024-07-23 13:06:46 -04:00
bbb651
db21801fbc WebAudio: Stub AudioBufferSourceNode
(cherry picked from commit 6672fb4b47ee0da35678f55088b4afdfce5fd10b)
2024-07-23 13:06:46 -04:00
Shannon Booth
6466fca20a LibWeb: Implement BaseAudioContext.createGain 2024-05-28 08:06:09 +02:00
Shannon Booth
71ccd8ad25 LibWeb: Implement BaseAudioContext.createBuffer
This is a simple factory function which effectively just calls the
AudioBuffer constructor.
2024-05-26 07:49:49 +02:00
Shannon Booth
452ffa56dc LibWeb: Implement BaseAudioContext.createDynamicsCompressor 2024-05-14 13:45:43 -04:00
Shannon Booth
5f57596520 LibWeb: Pass through sample rate in OfflineAudioContext constructor
I can't actually spot in the spec where it explicitly says to pass this
through (unlike the AudioContext constructor) - but clearly this needs
to be passed through for an OfflineAudioContext to actually have a
sample rate!
2024-05-04 14:01:38 +02:00
Shannon Booth
1678f43c38 LibWeb: Implement BaseAudioContext.createOscillator
Which currently will always throw an exception as it is unimplemented
under the hood - but this gives all of the plumbing we need in order to
create a oscillator node as used in the reduced turnstyle testcase.
2024-05-02 07:49:23 +02:00
Shannon Booth
bad44f8fc9 LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h
This was resulting in a whole lot of rebuilding whenever a new IDL
interface was added.

Instead, just directly include the prototype in every C++ file which
needs it. While we only really need a forward declaration in each cpp
file; including the full prototype header (which itself only includes
LibJS/Object.h, which is already transitively brought in by
PlatformObject) - it seems like a small price to pay compared to what
feels like a full rebuild of LibWeb whenever a new IDL file is added.

Given all of these includes are only needed for the ::initialize
method, there is probably a smart way of avoiding this problem
altogether. I've considered both using some macro trickery or generating
these functions somehow instead.
2024-04-27 18:29:35 -04:00
Shannon Booth
5cb6d495bb LibWeb: Implement verification of 'nominal' audio options
The spec doesn't tell us the exact value to use, but a minumum & maximum
range of supported values. Just to be consistent with another browser,
we follow the values that firefox appears to support from testing the
interface on my machine.

This function will be used in the AudioBuffer constructor, but is
defined in the spec as part of BaseAudioContext.
2024-04-25 19:26:19 -04:00
Andreas Kling
c0d7f748ed LibWeb: Avoid FlyString lookups when setting IDL interface prototypes
This commit introduces a WEB_SET_PROTOTYPE_FOR_INTERFACE macro that
caches the interface name in a local static FlyString. This means that
we only pay for FlyString-from-literal lookup once per browser lifetime
instead of every time the interface is instantiated.
2024-03-16 16:35:54 +01:00
Shannon Booth
96af80acd1 LibWeb: Port Intrinsics from DeprecatedString 2023-11-28 17:15:27 -05:00
Andreas Kling
18c54d8d40 LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs.

Work towards #20405
2023-08-08 07:39:11 +02:00
Daniel Adams
49e6414c58 LibWeb: Start filling out BaseAudioContext/AudioContext interfaces
- Fills out both IDLs and implements some basic attributes/methods.
- No actual audio processing yet though :^)
2023-06-28 05:22:51 +02:00
Luke Wilde
a5936864d9 LibWeb: Stub AudioContext constructor
This is enough to make Discord not throw up "Well this is awkward" on
login.
2023-05-22 06:07:05 +02:00