【问题标题】:Sox + MP3: libsox-fmt-mp3 not workingSox + MP3:libsox-fmt-mp3 不工作
【发布时间】:2014-04-24 19:16:45
【问题描述】:

我的服务器抛出了这个错误

Sox::Error (sox FAIL formats: no handler for file extension `mp3'
)

此人 (https://superuser.com/questions/421153/how-to-add-a-mp3-handler-to-sox) 遇到了类似问题。那里列出的解决方案是

sudo apt-get install libsox-fmt-mp3

运行此程序后,我仍然遇到相同的错误,因此我卸载了 sox (sudo apt-get remove sox),然后重新安装了它。在这一点上,我确信它们都安装了最新版本,因为任何安装它们的尝试都会产生这种情况

libsox-fmt-mp3 is already the newest version.
sox is already the newest version.

但是,我仍然收到同样的错误。

知道我错过了什么吗?

编辑:

我正在使用 ruby​​-sox gem (https://github.com/TMXCredit/ruby-sox),它表示以下内容应该足够了。

apt-get install libsox-fmt-all sox libchromaprint-dev

但是所有这些都安装了,仍然没有骰子。

编辑:

我认为发生这种情况的唯一方法是,如果 sox 在错误的位置查找 lib 文件。考虑到这一点,这些细节可能会有所帮助,

sudo find / -name sox
/usr/bin/sox
/usr/lib/x86_64-linux-gnu/sox
/usr/lib/mime/packages/sox
/usr/share/doc/sox
/home/deployer/apps/eko/shared/bundle/ruby/2.1.0/gems/ruby-sox-0.0.1/lib/sox

sudo find / -name libsox-fmt-mp3
/usr/share/doc/libsox-fmt-mp3

当我卸载 sox (apt-get remove sox) 时,我会在搜索 sox 时得到这个

ubuntu@ip-10-0-0-9:~$ sudo find / -name sox
/usr/lib/x86_64-linux-gnu/sox
/home/deployer/apps/eko/shared/bundle/ruby/2.1.0/gems/ruby-sox-0.0.1/lib/sox

为了摆脱这只袜子并希望在除了宝石体验之外的任何地方恢复到没有袜子的状态,我尝试了

sudo apt-get remove libsox-dev 

这告诉我 a) libsox-dev 没有安装 b) 我需要

sudo apt-get autoremove

删除大量不再需要的与 sox 相关的文件。此时,除了gem之外,没有sox文件。然后我

apt-get install libsox-fmt-all sox libchromaprint-dev

正如宝石所建议的那样。

没有骰子。同样的错误。

【问题讨论】:

  • 我玩游戏有点晚了,但我也遇到了这个问题。我按照另一篇文章中的建议安装了libsox-fmt-mp3,但无济于事。我的用例是录制通过互联网传输的音频。这是其他人收到此错误的情况吗?如果是,我认为问题可能是缺少 mp3 文件的标头。我尝试转换的 mp3 文件也无法在 VLC 媒体播放器中播放。

标签: audio mp3 sox


【解决方案1】:

Ult 决定只使用 wav。几个月后(也就是现在)需求发生了变化,为了支持 IE,我必须启动并运行 mp3 支持。上述所有问题仍然适用。

最终使用了 lame。

system "lame -b 32 --resample 8 -a #{Rails.root.join("tmp",@filename)} #{Rails.root.join("tmp",@output_file_name)}"

【讨论】:

  • 到达这里同样的问题。使用ffmpeg 做很多工作应该由sox 完成。
  • 这里也一样,无法让 sox 处理 heroku 上的 mp3,我想我会退回到跛脚
【解决方案2】:

我也遇到了这个问题。对我来说,问题是我收到了一个我认为是mp3 但实际上是aac 的音频流。 Sox 没有 aac 处理程序,但切换到 ffmpeg 就像一个魅力:

ffmpeg -i input.aac output.wav

【讨论】:

    猜你喜欢
    • 2012-05-20
    • 2012-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多