mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
LibWeb: Start filling out BaseAudioContext/AudioContext interfaces
- Fills out both IDLs and implements some basic attributes/methods. - No actual audio processing yet though :^)
This commit is contained in:
parent
30e67721ae
commit
49e6414c58
8 changed files with 407 additions and 8 deletions
|
@ -1,8 +1,31 @@
|
|||
#import <WebAudio/BaseAudioContext.idl>
|
||||
|
||||
// https://www.w3.org/TR/webaudio/#enumdef-audiocontextlatencycategory
|
||||
enum AudioContextLatencyCategory { "balanced", "interactive", "playback" };
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AudioContext
|
||||
[Exposed=Window]
|
||||
interface AudioContext : BaseAudioContext {
|
||||
// FIXME: Should be constructor (optional AudioContextOptions contextOptions = {});
|
||||
constructor();
|
||||
constructor(optional AudioContextOptions contextOptions = {});
|
||||
readonly attribute double baseLatency;
|
||||
readonly attribute double outputLatency;
|
||||
AudioTimestamp getOutputTimestamp ();
|
||||
Promise<undefined> resume ();
|
||||
Promise<undefined> suspend ();
|
||||
Promise<undefined> close ();
|
||||
// FIXME: MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement);
|
||||
// FIXME: MediaStreamAudioSourceNode createMediaStreamSource (MediaStream mediaStream);
|
||||
// FIXME: MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (MediaStreamTrack mediaStreamTrack);
|
||||
// FIXME: MediaStreamAudioDestinationNode createMediaStreamDestination ();
|
||||
};
|
||||
|
||||
dictionary AudioContextOptions {
|
||||
AudioContextLatencyCategory latencyHint = "interactive";
|
||||
float sampleRate;
|
||||
};
|
||||
|
||||
dictionary AudioTimestamp {
|
||||
double contextTime;
|
||||
// FIXME: Should be DOMHighResTimeStamp, but DOMHighResTimeStamp doesn't get parsed as a double during codegen
|
||||
double performanceTime;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue