Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 683
JoshMock Avatar asked Oct 21 '22 18:10

JoshMock


1 Answers

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.

like image 171
cwilso Avatar answered Oct 27 '22 11:10

cwilso