Search code examples
node.jsffmpegalsa

Read the audio file while it's being written in NodeJS


I am capturing audio through alsa using ffmpeg and writing it to a wav file. But as it's being written I need to send the captured audio to some 3rd party. I have tried few methods including node-growing-file but not able to succeed.

Is there a way I can read the file as a stream as long as it's being written and process it as required.


Solution

  • I don't know why this question was down voted. But after a lot of googling I found a NPM which does this job for you:

    Tailing Stream NPM

    It will read the audio file as long as it's being written and give you the output as stream.