Bill
Bill

Reputation: 5668

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?

Upvotes: 4

Views: 4958

Answers (1)

Brad
Brad

Reputation: 163272

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.

Upvotes: 4

Related Questions