Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Record incoming audio stream node js

I'm looking for a way to record an incoming audio stream from an external source (http://audio12.broadcastify.com/krjb6ymsvnhf54z.mp3?nocache=8396379) into a node server. Ultimately I want to do some processing in real time on the stream and listen for specific frequencies within the audio.

Is there anything out there to process incoming audio streams?

like image 754
Bill Avatar asked Sep 06 '25 02:09

Bill


1 Answers

There is a rewrite of the Web Audio API in JavaScript for Node.js: https://github.com/audiojs/web-audio-api

I think what would be easier in your case would be to use FFmpeg to fetch and decode the audio to PCM (via a simple child process, piping data to your app over STDIO), and then do your own processing from there.

If you're looking for specific frequencies consider an implementation of the Goertzel Algorithm. It's more efficient than doing a full FFT, if you only need a couple frequencies.

like image 156
Brad Avatar answered Sep 10 '25 20:09

Brad