Skip to content

Truly independent web browser

814 B
Raw Blame
// https://webaudio.github.io/web-audio-api/#enumdef-oscillatortype
enum OscillatorType {
    "sine",
    "square",
    "sawtooth",
    "triangle",
    "custom"
};

// https://webaudio.github.io/web-audio-api/#OscillatorOptions
dictionary OscillatorOptions : AudioNodeOptions {
    OscillatorType type = "sine";
    float frequency = 440;
    float detune = 0;
    PeriodicWave periodicWave;
};

// https://webaudio.github.io/web-audio-api/#OscillatorNode
[Exposed=Window, ImplementedIn=Rust]
interface OscillatorNode : AudioScheduledSourceNode {
    constructor(BaseAudioContext context, optional OscillatorOptions options = {});
    attribute OscillatorType type;
    readonly attribute AudioParam frequency;
    readonly attribute AudioParam detune;
    undefined setPeriodicWave(PeriodicWave periodicWave);
};