ladybird/Userland/Libraries/LibWeb/WebAudio/AudioBuffer.idl
Shannon Booth 0c8a98ac94 LibWeb: Begin implementing the interface for AudioBuffer
Implement the constructor and getChannelData function, working towards
the functionality that we need in order to implement
OfflineAudioContext.
2024-04-25 19:26:19 -04:00

23 lines
953 B
Text

// https://webaudio.github.io/web-audio-api/#AudioBufferOptions
dictionary AudioBufferOptions {
unsigned long numberOfChannels = 1;
required unsigned long length;
required float sampleRate;
};
// https://webaudio.github.io/web-audio-api/#AudioBuffer
[Exposed=Window]
interface AudioBuffer {
constructor (AudioBufferOptions options);
readonly attribute float sampleRate;
readonly attribute unsigned long length;
readonly attribute double duration;
readonly attribute unsigned long numberOfChannels;
Float32Array getChannelData(unsigned long channel);
undefined copyFromChannel(Float32Array destination,
unsigned long channelNumber,
optional unsigned long bufferOffset = 0);
undefined copyToChannel(Float32Array source,
unsigned long channelNumber,
optional unsigned long bufferOffset = 0);
};