Click here to download the Blitz Browser!

WPT

wpt / webaudio / the-audio-api / the-oscillatornode-interface / ctor-oscillator.html

Spec: Web Audio API ↗

Runs: Chrome 155.0.8041.0 (wpt@4a01b83e3, 2026-09-04) | Firefox 157.0a1 (wpt@e7122b73f, 2026-09-04) | Safari 251 preview (wpt@2c385f65e, 2026-09-04) | Ladybird 1.0-70fb3 (wpt@4a01b83e3, 2026-09-04) | Servo Servo 0.6 (wpt@7e3d005d7, 2026-09-03) | Blitz a50cb8971 (wpt@a95401e4e, 2026-09-03)

View on the Blitz WPT dashboard | Open test on wpt.live | wpt.fyi

ChromeFirefoxSafariLadybirdServoBlitz
Total62/6262/6262/6262/6262/62NOT RUN
SubtestChromeFirefoxSafariLadybirdServoBlitz
# AUDIT TASK RUNNER STARTED.PASSPASSPASSPASSPASS
Executing "initialize"PASSPASSPASSPASSPASS
Executing "invalid constructor"PASSPASSPASSPASSPASS
Executing "default constructor"PASSPASSPASSPASSPASS
Executing "test AudioNodeOptions"PASSPASSPASSPASSPASS
Executing "constructor options"PASSPASSPASSPASSPASS
Audit reportPASSPASSPASSPASSPASS
> [initialize] PASSPASSPASSPASSPASS
context = new OfflineAudioContext(...) did not throw an exception.PASSPASSPASSPASSPASS
< [initialize] All assertions passed. (total 1 assertions)PASSPASSPASSPASSPASS
> [invalid constructor] PASSPASSPASSPASSPASS
new OscillatorNode() threw TypeError: "Failed to construct 'OscillatorNode': 1 argument required, but only 0 present.".PASS
new OscillatorNode(1) threw TypeError: "Failed to construct 'OscillatorNode': parameter 1 is not of type 'BaseAudioContext'.".PASS
new OscillatorNode(context, 42) threw TypeError: "Failed to construct 'OscillatorNode': The provided value is not of type 'OscillatorOptions'.".PASS
< [invalid constructor] All assertions passed. (total 3 assertions)PASSPASSPASSPASSPASS
> [default constructor] PASSPASSPASSPASSPASS
node0 = new OscillatorNode(context) did not throw an exception.PASSPASSPASSPASSPASS
node0 instanceof OscillatorNode is equal to true.PASSPASSPASSPASSPASS
node0.numberOfInputs is equal to 0.PASSPASSPASSPASSPASS
node0.numberOfOutputs is equal to 1.PASSPASSPASSPASSPASS
node0.channelCount is equal to 2.PASSPASSPASSPASSPASS
node0.channelCountMode is equal to max.PASSPASSPASSPASSPASS
node0.channelInterpretation is equal to speakers.PASSPASSPASSPASSPASS
node0.type is equal to sine.PASSPASSPASSPASSPASS
node0.frequency.value is equal to 440.PASSPASSPASSPASSPASS
< [default constructor] All assertions passed. (total 9 assertions)PASSPASSPASSPASSPASS
> [test AudioNodeOptions] PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCount: 17}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelCount is equal to 17.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCount: 0}) threw NotSupportedError: "Failed to construct 'OscillatorNode': The channel count provided (0) is outside the range [1, 32].".PASS
new OscillatorNode(c, {channelCount: 99}) threw NotSupportedError: "Failed to construct 'OscillatorNode': The channel count provided (99) is outside the range [1, 32].".PASS
new OscillatorNode(c, {channelCountMode: "max"} did not throw an exception.PASSPASSPASSPASSPASS
node.channelCountMode is equal to max.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCountMode: "max"}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelCountMode after valid setter is equal to max.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCountMode: "clamped-max"}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelCountMode after valid setter is equal to clamped-max.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCountMode: "explicit"}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelCountMode after valid setter is equal to explicit.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelCountMode: "foobar"} threw TypeError: "Failed to construct 'OscillatorNode': Failed to read the 'channelCountMode' property from 'AudioNodeOptions': The provided value 'foobar' is not a valid enum value of type ChannelCountMode.".PASS
node.channelCountMode after invalid setter is equal to explicit.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelInterpretation: "speakers"}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelInterpretation is equal to speakers.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelInterpretation: "discrete"}) did not throw an exception.PASSPASSPASSPASSPASS
node.channelInterpretation is equal to discrete.PASSPASSPASSPASSPASS
new OscillatorNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Failed to construct 'OscillatorNode': Failed to read the 'channelInterpretation' property from 'AudioNodeOptions': The provided value 'foobar' is not a valid enum value of type ChannelInterpretation.".PASS
node.channelInterpretation after invalid setter is equal to discrete.PASSPASSPASSPASSPASS
< [test AudioNodeOptions] All assertions passed. (total 20 assertions)PASSPASSPASSPASSPASS
> [constructor options] PASSPASSPASSPASSPASS
node1 = new OscillatorNode(c, {"type":"sawtooth","detune":7,"frequency":918}) did not throw an exception.PASSPASSPASSPASSPASS
node1.type is equal to sawtooth.PASSPASSPASSPASSPASS
node1.detune.value is equal to 7.PASSPASSPASSPASSPASS
node1.frequency.value is equal to 918.PASSPASSPASSPASSPASS
node1.channelCount is equal to 2.PASSPASSPASSPASSPASS
node1.channelCountMode is equal to max.PASSPASSPASSPASSPASS
node1.channelInterpretation is equal to speakers.PASSPASSPASSPASSPASS
new OscillatorNode(c, {"type":"sine","periodicWave":{}}) did not throw an exception.PASSPASSPASSPASSPASS
new OscillatorNode(c, {"type":"custom"}) threw InvalidStateError: "Failed to construct 'OscillatorNode': A PeriodicWave must be specified if the type is set to "custom"".PASS
new OscillatorNode(c, {"type":"custom","periodicWave":{}}) did not throw an exception.PASSPASSPASSPASSPASS
new OscillatorNode(c, {periodicWave: null} threw TypeError: "Failed to construct 'OscillatorNode': Failed to read the 'periodicWave' property from 'OscillatorOptions': Failed to convert value to 'PeriodicWave'.".PASS
< [constructor options] All assertions passed. (total 11 assertions)PASSPASSPASSPASSPASS
# AUDIT TASK RUNNER FINISHED: 5 tasks ran successfully.PASSPASSPASSPASSPASS
new OscillatorNode() threw TypeError: "OscillatorNode constructor: At least 1 argument required, but only 0 passed".PASS
new OscillatorNode(1) threw TypeError: "OscillatorNode constructor: Argument 1 is not an object.".PASS
new OscillatorNode(context, 42) threw TypeError: "OscillatorNode constructor: Value can't be converted to a dictionary.".PASS
new OscillatorNode(c, {channelCount: 0}) threw NotSupportedError: "OscillatorNode constructor: Channel count (0) must be in the range [1, max supported channel count]".PASS
new OscillatorNode(c, {channelCount: 99}) threw NotSupportedError: "OscillatorNode constructor: Channel count (99) must be in the range [1, max supported channel count]".PASS
new OscillatorNode(c, {channelCountMode: "foobar"} threw TypeError: "OscillatorNode constructor: 'foobar' (value of 'channelCountMode' member of AudioNodeOptions) is not a valid value for enumeration ChannelCountMode.".PASS
new OscillatorNode(c, {channelInterpretation: "foobar"}) threw TypeError: "OscillatorNode constructor: 'foobar' (value of 'channelInterpretation' member of AudioNodeOptions) is not a valid value for enumeration ChannelInterpretation.".PASS
new OscillatorNode(c, {"type":"custom"}) threw InvalidStateError: "OscillatorNode constructor: Can't set type to "custom"".PASS
new OscillatorNode(c, {periodicWave: null} threw TypeError: "OscillatorNode constructor: 'periodicWave' member of OscillatorOptions is not an object.".PASS
new OscillatorNode() threw TypeError: "Not enough arguments".PASS
new OscillatorNode(1) threw TypeError: "Argument 1 ('context') to the OscillatorNode constructor must be an instance of BaseAudioContext".PASS
new OscillatorNode(context, 42) threw TypeError: "Type error".PASS
new OscillatorNode(c, {channelCount: 0}) threw NotSupportedError: "Channel count cannot be 0".PASS
new OscillatorNode(c, {channelCount: 99}) threw NotSupportedError: "Channel count exceeds maximum limit".PASS
new OscillatorNode(c, {channelCountMode: "foobar"} threw TypeError: "Type error".PASS
new OscillatorNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Type error".PASS
new OscillatorNode(c, {"type":"custom"}) threw InvalidStateError: "Must provide periodicWave when using custom type.".PASS
new OscillatorNode(c, {periodicWave: null} threw TypeError: "Type error".PASS
new OscillatorNode() threw TypeError: "Not enough arguments to "OscillatorNode.constructor".".PASS
new OscillatorNode(1) threw TypeError: "Value is not an object.".PASS
new OscillatorNode(context, 42) threw TypeError: "Value is not an object.".PASS
new OscillatorNode(c, {channelCount: 0}) threw NotSupportedError: "The operation is not supported.".PASS
new OscillatorNode(c, {channelCount: 99}) threw NotSupportedError: "The operation is not supported.".PASS
new OscillatorNode(c, {channelCountMode: "foobar"} threw TypeError: "'foobar' is not a valid enum value for enumeration 'ChannelCountMode'.".PASS
new OscillatorNode(c, {channelInterpretation: "foobar"}) threw TypeError: "'foobar' is not a valid enum value for enumeration 'ChannelInterpretation'.".PASS
new OscillatorNode(c, {"type":"custom"}) threw InvalidStateError: "Can not set oscillator type to custom without providing a periodic wave".PASS
new OscillatorNode(c, {periodicWave: null} threw TypeError: "Value is not an object.".PASS
new OscillatorNode() threw TypeError: "OscillatorNode() needs one argument".PASS
new OscillatorNode(1) threw TypeError: "Not an object of type BaseAudioContext".PASS
new OscillatorNode(context, 42) threw TypeError: "Not an object of type OscillatorOptions".PASS
new OscillatorNode(c, {channelCount: 0}) threw NotSupportedError: "Invalid channel count".PASS
new OscillatorNode(c, {channelCount: 99}) threw NotSupportedError: "Invalid channel count".PASS
new OscillatorNode(c, {channelCountMode: "foobar"} threw TypeError: "Invalid value 'foobar' for enumeration type 'ChannelCountMode'".PASS
new OscillatorNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Invalid value 'foobar' for enumeration type 'ChannelInterpretation'".PASS
new OscillatorNode(c, {"type":"custom"}) threw InvalidStateError: "Oscillator node type 'custom' requires PeriodicWave to be provided".PASS
new OscillatorNode(c, {periodicWave: null} threw TypeError: "Not an object of type PeriodicWave".PASS