将原始 PCM 流转换为 wavs (cli)

发布于 2024-08-19 21:34:49 字数 182 浏览 1 评论 0原文

我需要一个程序,可以将原始 PCM 流传输到其中,并将 wav 文件发送到标准输出。

由于输入是一个流,我不能只向其中添加标头,但我可以每隔 x 秒(例如,程序读取十秒的流,并输出一个十秒长的 wav文件,读取接下来的十秒,输出一个 wav 文件,等等)。

有没有一个程序可以做到这一点?它需要在 Linux 上运行。

I need a program that I can pipe a raw PCM stream into, and will send wav files to stdout.

Since the input is a stream, I can't just add headers to it, but I can for every x seconds (For example, program reads ten seconds of the stream, and outputs a ten second long wav file, reads the next ten seconds, outputs a wav file, and so on).

Is there a program that can do this? It needs to run on Linux.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回梦 2024-08-26 21:34:49

查看sox,声音处理的瑞士军刀。

Check out sox, the Swiss Army knife of sound processing.

满地尘埃落定 2024-08-26 21:34:49

这是一个编写起来非常简单的程序,事实上,如果您可以保证每个波形文件中的 PCM 数据字节数完全相同,您只需为此预先创建一个标准波形文件头即可PCM 数据量,然后只是 cat wavehdr + chunk-of-streamdata

This is a dead simple program to write, in fact, if you can guarantee exactly the same number of bytes of PCM data in each wave file, you can just pre-create a standard wave file header for that amount of PCM data and then just cat wavehdr + chunk-of-streamdata

堇色安年 2024-08-26 21:34:49

mplayer 非常适合此类任务。它带有两个界面,mencoder 和 mplayer。 mencoder 作为您想要将原始 pcm 转换为各种声音格式的所有命令行开关。

它还附带了一个很长的手册页,很好地解释了所有选项。

mplayer is quite good for this kind of tasks. It comes with two interface, mencoder and mplayer. mencoder as all the command line switch you want to transform raw pcm into various sound format.

It also come with a very long man page that explains all the options quite well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文