Is it (or will be) possible to use Librosa to make real-time audio analysis, reading the audio not from a file but from a stream (like from Jack on Linux or from a sound card input)?
Probably it can be done working on little frames of some thousands of samples, but I have no idea of time needed for processing and if it can be done at a decent rate...
Sure. The simplest thing right now is to use PyAudio to generate audio frames and use a callback to do the analysis. This works, but the latency can be pretty bad, and you may end up dropping frames. Depending on your application, it may be good enough: see this post for an example.
One issue here is that not every analysis method is amenable to streaming applications. But simple frame-based analysis should work.
This won't work with librosa.load due to its use of audioread on the backend. (See #140 .) But as long as you can get audio data into a numpy array somehow, it should be fine.
Ok, thanks!
There is an option called librosa.stream but not sure whether it can fit into pyaudio applications!
Most helpful comment
Sure. The simplest thing right now is to use PyAudio to generate audio frames and use a callback to do the analysis. This works, but the latency can be pretty bad, and you may end up dropping frames. Depending on your application, it may be good enough: see this post for an example.
One issue here is that not every analysis method is amenable to streaming applications. But simple frame-based analysis should work.
This won't work with
librosa.loaddue to its use of audioread on the backend. (See #140 .) But as long as you can get audio data into a numpy array somehow, it should be fine.