-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Feature Request
I’m using an AnalyserNode for real-time pitch and volume analysis on short audio buffers. I don’t need to record or store the full audio stream.
However, it seems that the AnalyserNode only produces usable data (e.g. getFloatTimeDomainData) when it is ultimately connected to AudioContext.destination. This forces me to route the audio to a (silent) destination, which results in the full audio being recorded and kept in memory, causing linearly increasing memory usage over time.
Current setup
To make the AnalyserNode usable, I currently have to connect the graph like this:
recorder -> adapter -> analyser -> silentGain -> destination
The silentGain node sets the audio to zero so nothing is audible, but the audio still flows to destination.
Expected behavior
It should be possible to use an AnalyserNode for analysis only, without connecting it to AudioContext.destination, for example:
recorder -> adapter -> analyser
Is this a known limitation of the Web Audio API?
Or is there a recommended way to perform analysis without routing audio to AudioContext and incurring the associated memory overhead?