This is part of our project to update code to a more modern JS syntax.
This PR updates the audio-analyser example:
Use const and let where possible
Use arrow functions where possible
In addition:
Use now the unprefixed version of Web Audio API and requestAnimationFrame() only (ubiquitous and prefixed versions are not supported by browsers anymore)
Pass Prettier
Fix the HTML code:
Declare the language
Fix a </p> that was autoclosed by transforming it into a <div>.
Fix the title
Use fetch() instead XHR.
Lots of cleanups: adding an <h1>, minimizing variable declaration at the top, improving messages, disabling widgets that cannot be used at that moment…
This doesn't remove createScriptProcessor that is deprecated in favor of audio worklets; too much work for this PR.
Tested on Firefox, Safari, and Chrome (macOS) via a local server.
This is part of our project to update code to a more modern JS syntax.
This PR updates the audio-analyser example:
const
andlet
where possibleIn addition:
requestAnimationFrame()
only (ubiquitous and prefixed versions are not supported by browsers anymore)</p>
that was autoclosed by transforming it into a<div>
.fetch()
instead XHR.<h1>
, minimizing variable declaration at the top, improving messages, disabling widgets that cannot be used at that moment…This doesn't remove
createScriptProcessor
that is deprecated in favor of audio worklets; too much work for this PR.Tested on Firefox, Safari, and Chrome (macOS) via a local server.