Click here to download the Blitz Browser!

WPT

wpt / webaudio / the-audio-api / the-audiobuffer-interface / ctor-audiobuffer.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 "required options"PASSPASSPASSPASSPASS
Executing "invalid option values"PASSPASSPASSPASSPASS
Executing "default constructor"PASSPASSPASSPASSPASS
Executing "valid constructor"PASSPASSPASSPASSPASS
Executing "multiple contexts"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 AudioBuffer() threw TypeError: "Failed to construct 'AudioBuffer': 1 argument required, but only 0 present.".PASS
new AudioBuffer(1) threw TypeError: "Failed to construct 'AudioBuffer': The provided value is not of type 'AudioBufferOptions'.".PASS
new AudioBuffer(Date, 42) threw TypeError: "Failed to construct 'AudioBuffer': Failed to read the 'sampleRate' property from 'AudioBufferOptions': Required member is undefined.".PASS
< [invalid constructor] All assertions passed. (total 3 assertions)PASSPASSPASSPASSPASS
> [required options] PASSPASSPASSPASSPASS
buffer = new AudioBuffer({}) threw TypeError: "Failed to construct 'AudioBuffer': Failed to read the 'length' property from 'AudioBufferOptions': Required member is undefined.".PASS
buffer = new AudioBuffer({length: 1}) threw TypeError: "Failed to construct 'AudioBuffer': Failed to read the 'sampleRate' property from 'AudioBufferOptions': Required member is undefined.".PASS
buffer = new AudioBuffer({sampleRate: 48000}) threw TypeError: "Failed to construct 'AudioBuffer': Failed to read the 'length' property from 'AudioBufferOptions': Required member is undefined.".PASS
buffer = new AudioBuffer({numberOfChannels: 1} threw TypeError: "Failed to construct 'AudioBuffer': Failed to read the 'length' property from 'AudioBufferOptions': Required member is undefined.".PASS
buffer0 = new AudioBuffer({length: 21, sampleRate: 48000} did not throw an exception.PASSPASSPASSPASSPASS
buffer0.numberOfChannels is equal to 1.PASSPASSPASSPASSPASS
buffer0.length is equal to 21.PASSPASSPASSPASSPASS
buffer0.sampleRate is equal to 48000.PASSPASSPASSPASSPASS
buffer1 = new AudioBuffer({numberOfChannels: 3, length: 1, sampleRate: 48000}) did not throw an exception.PASSPASSPASSPASSPASS
buffer1.numberOfChannels is equal to 3.PASSPASSPASSPASSPASS
buffer1.length is equal to 1.PASSPASSPASSPASSPASS
buffer1.sampleRate is equal to 48000.PASSPASSPASSPASSPASS
< [required options] All assertions passed. (total 12 assertions)PASSPASSPASSPASSPASS
> [invalid option values] PASSPASSPASSPASSPASS
new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000}) threw NotSupportedError: "Failed to construct 'AudioBuffer': The number of channels provided (0) is outside the range [1, 32].".PASS
new AudioBuffer({"numberOfChannels":99,"length":0,"sampleRate":16000}) threw NotSupportedError: "Failed to construct 'AudioBuffer': The number of channels provided (99) is outside the range [1, 32].".PASS
new AudioBuffer({"numberOfChannels":1,"length":0,"sampleRate":16000}) threw NotSupportedError: "Failed to construct 'AudioBuffer': The number of frames provided (0) is less than or equal to the minimum bound (0).".PASS
new AudioBuffer({"numberOfChannels":1,"length":1,"sampleRate":100}) threw NotSupportedError: "Failed to construct 'AudioBuffer': The sample rate provided (100) is outside the range [3000, 768000].".PASS
< [invalid option values] All assertions passed. (total 4 assertions)PASSPASSPASSPASSPASS
> [default constructor] PASSPASSPASSPASSPASS
buffer = new AudioBuffer({"numberOfChannels":5,"length":17,"sampleRate":16000}) did not throw an exception.PASSPASSPASSPASSPASS
buffer.numberOfChannels is equal to 5.PASSPASSPASSPASSPASS
buffer.length is equal to 17.PASSPASSPASSPASSPASS
buffer.sampleRate is equal to 16000.PASSPASSPASSPASSPASS
< [default constructor] All assertions passed. (total 4 assertions)PASSPASSPASSPASSPASS
> [valid constructor] PASSPASSPASSPASSPASS
new AudioBuffer({"numberOfChannels":3,"length":42,"sampleRate":54321}) did not throw an exception.PASSPASSPASSPASSPASS
buffer.numberOfChannels is equal to 3.PASSPASSPASSPASSPASS
buffer.length is equal to 42.PASSPASSPASSPASSPASS
buffer.sampleRate is equal to 54321.PASSPASSPASSPASSPASS
buffer.getChannelData(0) did not throw an exception.PASSPASSPASSPASSPASS
buffer.getChannelData(0) length is equal to 42.PASSPASSPASSPASSPASS
buffer.getChannelData(1) did not throw an exception.PASSPASSPASSPASSPASS
buffer.getChannelData(1) length is equal to 42.PASSPASSPASSPASSPASS
buffer.getChannelData(2) did not throw an exception.PASSPASSPASSPASSPASS
buffer.getChannelData(2) length is equal to 42.PASSPASSPASSPASSPASS
buffer.getChannelData(3) threw IndexSizeError: "Failed to execute 'getChannelData' on 'AudioBuffer': channel index (3) exceeds number of channels (3)".PASS
< [valid constructor] All assertions passed. (total 11 assertions)PASSPASSPASSPASSPASS
> [multiple contexts] PASSPASSPASSPASSPASS
c1 result is identical to the array [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16...].PASSPASSPASSPASSPASS
c2 result is identical to the array [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16...].PASSPASSPASSPASSPASS
AudioBuffer shared between two different contexts correctlyPASSPASSPASSPASSPASS
< [multiple contexts] All assertions passed. (total 3 assertions)PASSPASSPASSPASSPASS
# AUDIT TASK RUNNER FINISHED: 7 tasks ran successfully.PASSPASSPASSPASSPASS
new AudioBuffer() threw TypeError: "AudioBuffer constructor: At least 1 argument required, but only 0 passed".PASS
new AudioBuffer(1) threw TypeError: "AudioBuffer constructor: Argument 1 can't be converted to a dictionary.".PASS
new AudioBuffer(Date, 42) threw TypeError: "AudioBuffer constructor: Missing required 'sampleRate' member of AudioBufferOptions.".PASS
buffer = new AudioBuffer({}) threw TypeError: "AudioBuffer constructor: Missing required 'length' member of AudioBufferOptions.".PASS
buffer = new AudioBuffer({length: 1}) threw TypeError: "AudioBuffer constructor: Missing required 'sampleRate' member of AudioBufferOptions.".PASS
buffer = new AudioBuffer({sampleRate: 48000}) threw TypeError: "AudioBuffer constructor: Missing required 'length' member of AudioBufferOptions.".PASS
buffer = new AudioBuffer({numberOfChannels: 1} threw TypeError: "AudioBuffer constructor: Missing required 'length' member of AudioBufferOptions.".PASS
new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000}) threw NotSupportedError: "AudioBuffer constructor: Must have nonzero number of channels".PASS
new AudioBuffer({"numberOfChannels":99,"length":0,"sampleRate":16000}) threw NotSupportedError: "AudioBuffer constructor: Number of channels (99) is out of range".PASS
new AudioBuffer({"numberOfChannels":1,"length":0,"sampleRate":16000}) threw NotSupportedError: "AudioBuffer constructor: Length (0) is out of range".PASS
new AudioBuffer({"numberOfChannels":1,"length":1,"sampleRate":100}) threw NotSupportedError: "AudioBuffer constructor: Sample rate (100) is out of range".PASS
buffer.getChannelData(3) threw IndexSizeError: "AudioBuffer.getChannelData: Channel number (3) is out of range".PASS
new AudioBuffer() threw TypeError: "Not enough arguments".PASS
new AudioBuffer(1) threw TypeError: "Type error".PASS
new AudioBuffer(Date, 42) threw TypeError: "Member AudioBufferOptions.sampleRate is required and must be an instance of float".PASS
buffer = new AudioBuffer({}) threw TypeError: "Member AudioBufferOptions.length is required and must be an instance of unsigned long".PASS
buffer = new AudioBuffer({length: 1}) threw TypeError: "Member AudioBufferOptions.sampleRate is required and must be an instance of float".PASS
buffer = new AudioBuffer({sampleRate: 48000}) threw TypeError: "Member AudioBufferOptions.length is required and must be an instance of unsigned long".PASS
buffer = new AudioBuffer({numberOfChannels: 1} threw TypeError: "Member AudioBufferOptions.length is required and must be an instance of unsigned long".PASS
new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000}) threw NotSupportedError: "Number of channels cannot be 0.".PASS
new AudioBuffer({"numberOfChannels":99,"length":0,"sampleRate":16000}) threw NotSupportedError: "Number of channels cannot be more than max supported.".PASS
new AudioBuffer({"numberOfChannels":1,"length":0,"sampleRate":16000}) threw NotSupportedError: "Length must be at least 1.".PASS
new AudioBuffer({"numberOfChannels":1,"length":1,"sampleRate":100}) threw NotSupportedError: "Sample rate is not in the supported range.".PASS
buffer.getChannelData(3) threw IndexSizeError: "Index must be less than number of channels.".PASS
new AudioBuffer() threw TypeError: "Not enough arguments to "AudioBuffer.constructor".".PASS
new AudioBuffer(1) threw TypeError: "Value is not an object.".PASS
new AudioBuffer(Date, 42) threw TypeError: "Missing required member "sampleRate".".PASS
buffer = new AudioBuffer({}) threw TypeError: "Missing required member "length".".PASS
buffer = new AudioBuffer({length: 1}) threw TypeError: "Missing required member "sampleRate".".PASS
buffer = new AudioBuffer({sampleRate: 48000}) threw TypeError: "Missing required member "length".".PASS
buffer = new AudioBuffer({numberOfChannels: 1} threw TypeError: "Missing required member "length".".PASS
new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000}) threw NotSupportedError: "The operation is not supported.".PASS
new AudioBuffer({"numberOfChannels":99,"length":0,"sampleRate":16000}) threw NotSupportedError: "The operation is not supported.".PASS
new AudioBuffer({"numberOfChannels":1,"length":0,"sampleRate":16000}) threw NotSupportedError: "The operation is not supported.".PASS
new AudioBuffer({"numberOfChannels":1,"length":1,"sampleRate":100}) threw NotSupportedError: "The operation is not supported.".PASS
buffer.getChannelData(3) threw IndexSizeError: "The index is not in the allowed range.".PASS
new AudioBuffer() threw TypeError: "AudioBuffer() needs one argument".PASS
new AudioBuffer(1) threw TypeError: "Not an object of type AudioBufferOptions".PASS
new AudioBuffer(Date, 42) threw TypeError: "Required property sampleRate is missing or undefined".PASS
buffer = new AudioBuffer({}) threw TypeError: "Required property length is missing or undefined".PASS
buffer = new AudioBuffer({length: 1}) threw TypeError: "Required property sampleRate is missing or undefined".PASS
buffer = new AudioBuffer({sampleRate: 48000}) threw TypeError: "Required property length is missing or undefined".PASS
buffer = new AudioBuffer({numberOfChannels: 1} threw TypeError: "Required property length is missing or undefined".PASS
new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000}) threw NotSupportedError: "Number of channels must not be '0'".PASS
new AudioBuffer({"numberOfChannels":99,"length":0,"sampleRate":16000}) threw NotSupportedError: "Number of channels is greater than allowed range".PASS
new AudioBuffer({"numberOfChannels":1,"length":0,"sampleRate":16000}) threw NotSupportedError: "Length of buffer must be at least 1".PASS
new AudioBuffer({"numberOfChannels":1,"length":1,"sampleRate":100}) threw NotSupportedError: "Sample rate is outside of allowed range".PASS
buffer.getChannelData(3) threw IndexSizeError: "Channel index is out of range".PASS