简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM