mdn / webaudio-examples

Code examples that accompany the MDN Web Docs pages relating to Web Audio.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
Creative Commons Zero v1.0 Universal
1.25k stars 433 forks source link

white noise live demo throws error #84

Closed aprice2704 closed 1 year ago

aprice2704 commented 2 years ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBuffer

What specific section or headline is this issue about?

white noise live demo throws error in Chrome

What information was incorrect, unhelpful, or incomplete?

The white noise demo at https://mdn.github.io/webaudio-examples/audio-buffer/ produces an error: on the js console

Uncaught TypeError: Failed to construct 'AudioBuffer': Failed to read the 'length' property from 'AudioBufferOptions': Required member is undefined.
    at button.onclick ((index):35:22)

as a result, it plays no noise :(

What did you expect to see?

no error, white noise played

Do you have any supporting links, references, or citations?

Chrome: Version 105.0.5195.52 (Official Build) beta (64-bit) Windows 11 build : 22000.856

Do you have anything more you want to share?

No response

MDN metadata

Page report details * Folder: `en-us/web/api/baseaudiocontext/createbuffer` * MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBuffer * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/baseaudiocontext/createbuffer/index.md * Last commit: https://github.com/mdn/content/commit/ebdeb85d2e1d5111ccb688221cfa28b321874b9e * Document last modified: 2022-06-03T04:22:01.000Z
teoli2003 commented 2 years ago

It throws on Firefox too. But this is weird… I would have bet to have tested it about one month ago, and I don't really understand the message, given the code. (even with the debugger).

Leokuma commented 2 years ago

I think I found it.

The code at github-pages is outdated. The code in the repo does work. Apparently there was an error when deploying it to github-pages:

image https://github.com/mdn/webaudio-examples/deployments

bsmth commented 1 year ago

Hi @aprice2704 , thanks for raising the issue. It looks like this is resolved now so I will move this to closed.

Thank you :)