GoogleChromeLabs / audioworklet-polyfill

🔊 Polyfill AudioWorklet using the legacy ScriptProcessor API.
https://googlechromelabs.github.io/audioworklet-polyfill/
Apache License 2.0
196 stars 20 forks source link

Connect output-less script processor to destination to allow processing #26

Open hgcummings opened 4 years ago

hgcummings commented 4 years ago

As described in the code comment:

The use case for input-only processors is performing audio analysis (rather than audio manipulation), e.g. for visualisation.

Tested in iOS Safari 12. Note that for the polyfill to work for me at all on this platform, I also needed PR #25 .

Some things that didn't work:

Connecting without going through a zero-gain node would only cause surprising behaviour if someone created a polyfill AudioWorkletNode with numberOfOutputs: 0 and then tried to output something from the node, which would suggest a programming error in any case.