如何将 16 位 wav 转换为原始音频

发布于 2025-01-07 13:56:28 字数 210 浏览 6 评论 0原文

我正在尝试使用 sox 将星号语音邮件转换为原始音频。原始 wav 的编码信息是 PCM S16 LE,所以我以为我只能执行 sox msg0000.wav msg0001.raw 但原始文件是乱码,根据 VLC,源文件长 4 分钟,而源文件长 6 秒。

我不确定我哪里出错了,有人如何将 wav 转换为 raw 吗?最好使用 sox,但任何命令行解决方案都可以。

I'm trying to use sox to convert asterisk voicemails to raw audio. The encoding information of the original wav is PCM S16 LE, so I thought I would just be able to do sox msg0000.wav msg0001.raw but the raw file from that is garbled and, according to VLC, 4 minutes long, compared to a 6 second source file.

I'm not sure where I'm going wrong, anybody how to convert a wav to raw? Preferably using sox, but any commandline solution will do fine.

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

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

发布评论

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

评论(1

一杆小烟枪 2025-01-14 13:56:28

您确定问题出在 sox 而不是 VLC 上吗?我在让 VLC 播放原始音频时也遇到了问题。有命令行选项,但我没有完全让它们工作。

在寻找其他工具之前,请尝试通过尝试类似的方法来验证 sox 确实是问题所在

mplayer -rawaudio samplesize=2:channels=1:rate=8000 -demuxer rawaudio msg0001.raw

。Also, sox can be 鉴于其他选项:

sox msg0000.wav --bits 16 --encoding signed-integer --endian little msg0001.raw

但我怀疑这些是默认设置,因此不需要它们。

Are you sure that your problem is with sox and not VLC? I've also had problems getting VLC to play raw audio. There are command-line options but I didn't quite get them to work.

Before looking for another tool, verify that sox is indeed the problem by trying something like

mplayer -rawaudio samplesize=2:channels=1:rate=8000 -demuxer rawaudio msg0001.raw

Also, sox can be given additional options:

sox msg0000.wav --bits 16 --encoding signed-integer --endian little msg0001.raw

But I suspect that these are the default settings, so they shouldn't be needed.

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