Is the Web Audio API useful for doing faster-than-realtime audio analysis?

589 views Asked by At

I have been trying to establish whether the Web Audio API might be useful for analysis of audio data pulled into an ArrayBuffer in faster than realtime. Possible applications would be doing beat detection, pitch detection, etc., in the browser rather than passing files to a server to do the work.

The AnalyserNode interface seems a good fit for such a task, but it feels clunky because it still requires chaining to a AudioBufferSourceNode and start()ing it before you get any data. And, to do it faster than realtime would require bumping up its playbackRate which would reduce the quality of the analysis.

Alternatively, using dsp.js may be a better fit, but its repository has been all but inactive for a couple years, which isn't a huge vote of confidence.

I guess the root question is: is the Web Audio API intended for analysis work or is its sole purpose (and thus what it's designed and optimized for) performance and playback? If it's not, have any other standards or tools been proposed or built specifically for audio analysis? Did I answer my own question by mentioning dsp.js?

1

There are 1 answers

1
cwilso On BEST ANSWER

Not really, no - there's no current way to use the analyser in faster-than-realtime. WA does do analysis, but not faster than realtime, at this point.