在 NodeJS 中读取音频文件 [英] Read the audio file while it's being written in NodeJS
问题描述
我正在使用 ffmpeg 通过 alsa 捕获音频并将其写入 wav 文件.但是当它正在编写时,我需要将捕获的音频发送给某个 3rd 方.我尝试了几种方法,包括 node-GRing-file 但未能成功.
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.
推荐答案
我不知道为什么这个问题被否决了.但是经过大量谷歌搜索后,我找到了一个 NPM 可以为您完成这项工作:
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屋!