0

I'm trying to record audio from one of my audio interfaces by using ffmpeg.

I want to do this in order to send this audio afterward via websocket with NodeJS.

I'm able to record the audio with ffmpeg and save it to an audio file, but I do not want to save it, I just want the audio stream in order to execute the ffmpeg command from NodeJS and use this audio stream with the websocket.

This is my current ffmpeg command:

ffmpeg -f alsa -i hw:0,0 -af "pan=2c|c0=c0" output.wav

Is there any way of using it without the output file?

  • Do you mean you want to pipe the audio to a different process? `ffmpeg -f alsa -i hw:0,0 -af "pan=2c|c0=c0" -f wav - | foo` – llogan Apr 05 '18 at 17:00
  • Not exactly, from NodeJS I will call this command by using spawn: var args = '-f alsa -i hw:0,0 etc'.split(' '); return spawn('ffmpeg', args).stdout; The sdtout will be sent by websocket to the clients. The problem is that I cannot execute that command since it must have an audio output (which I do not want). –  Apr 05 '18 at 18:54
  • https://stackoverflow.com/questions/31834456/how-to-use-ffmpeg-for-streaming-mp4-via-websocket if your research is successful you might want to post your answer for the next person ... also take a peek at https://stackoverflow.com/questions/21204582/live-streaming-using-ffmpeg-to-web-audio-api – Scott Stensland Apr 05 '18 at 21:57

0 Answers0