使用 SOX 从 16 位 WAV 转换为 GSM
我目前正在研究与 Asterisk 和 PHP Web 界面的一些电话集成。我想为用户提供一个选项,以将他们自己的自定义问候语上传到 wav 文件中,然后一旦到达服务器,就将 wav 转换为 8000hz 的 gsm 文件。目前,我正在尝试使用 sox 来完成此任务。
然而,似乎当我在 8khz sav 以外的任何内容之间转换为 gsm 时,gsm 文件严重失真。这几乎就像它使文件速度减慢了 10 倍(wav 格式的 3 秒介绍变成了 30 秒 gsm 文件)我尝试了几种速度和重采样的组合,但无济于事。理想情况下,我希望获取上传的任何 wav 文件并对其进行转换,而不需要用户承担太多对其进行正确编码的责任。我绝对不是一个发烧友,所以如果有人能指出我正确的方向,我将不胜感激。
I'm currently working on some telephony integration with Asterisk and a PHP web interface. I want to give the user an option to upload their own custom greeting in a wav file, and then once it's on the server convert the wav to a gsm file at 8000hz. Currently, i'm trying to use sox to accomplish this.
However, it seems like when I convert between anything other than an 8khz sav to gsm, the gsm file is severely distorted. It's almost like it slows down the file by a factor of 10 (a 3 second intro in wav format turns into a 30 second gsm file) I've tried several combinations of speed and resampling to no avail. Ideally, I would like to take any wav file that's uploaded and convert it, without putting too much responsibility on the user to encode it properly. I'm definitely not an audiophile, so if anybody could point me in the right direction it would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是我用来将常规 16 位 .wav 文件转换为 8 位单声道 .gsm 文件的命令(工作正常):
This is the command that I use to convert regular 16-bit .wav files to 8-bit mono .gsm files (works fine):
我见过 sox 的情况,我需要分解更改并一个接一个地通过管道传输它们,而不是在一个命令中。
你的 sox cmd 是什么样的?
您能否先将 wav 转换为 8khz,然后转码,将一个 sox 调用的输出通过管道传输到另一个?
I have seen cases with sox where I needed to break up changes and pipe them one after another rather then in one command.
What does your sox cmd look like?
Could you first convert the wav to 8khz, then transcode, piping the output from the one sox call to the other?
我用
I use
只是有点晚了,我目前使用:
Just a little late, I current use: