在NodeJS中编写音频文件时读取音频文件 [英] Read the audio file while it's being written in NodeJS
问题描述
我正在使用ffmpeg通过alsa捕获音频并将其写入wav文件。但是在编写过程中,我需要将捕获的音频发送给某个第三方。我尝试了几种方法,包括 node-growing-file ,但无法成功。 / p>
有没有一种方法可以将文件读取为流,只要它正在写入并根据需要进行处理即可。
我不知道为什么这个问题被否决。但是经过大量的搜索之后,我发现了一个NPM可以为您完成这项工作:
只要被写入,它将读取音频文件,并为您提供输出流。
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.
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:
It will read the audio file as long as it's being written and give you the output as stream.
这篇关于在NodeJS中编写音频文件时读取音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!