windows sox FAIL util:无法加载 MAD 解码器库 (libmad) 函数“mad_stream_buffer”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3537155/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:33:21  来源:igfitidea点击:

sox FAIL util: Unable to load MAD decoder library (libmad) function "mad_stream_buffer"

windowsvisual-c++dllmp3sox

提问by Anderson

I compiled libmad for sox. When I try to read an mp3 I get this message:

我为 sox 编译了 libmad。当我尝试阅读 mp3 时,我收到以下消息:

sox FAIL util: Unable to load MAD decoder library (libmad) function "mad_stream_buffer".

sox FAIL util:无法加载 MAD 解码器库 (libmad) 函数“mad_stream_buffer”。

Did I compile the project incorrectly?

我是否错误地编译了项目?

回答by bulltorious

Steps to using SOX to create MP3s:

使用 SOX 制作 MP3 的步骤:

  1. Download latest version of SOXand install.
  2. Download libmad-0.dlland libmp3lame-0.dll. The currently only known trustworthy source is ossbuildbut this requires you to download a 1.5 GB archive. The selected two files are available hereand here.
  3. Add libmad-0.dlland libmp3lame-0.dllto the folder where SOX was installed to.
  4. Use the command line to convert a file to .mp3:

    sox input.wav -c 2 -C 128 output.mp3
    
  1. 下载最新版本的SOX并安装。
  2. 下载libmad-0.dlllibmp3lame-0.dll。目前唯一已知的值得信赖的来源是ossbuild,但这需要您下载 1.5 GB 的存档。此处此处提供所选的两个文件。
  3. libmad-0.dll和添加libmp3lame-0.dll到安装 SOX 的文件夹中。
  4. 使用命令行将文件转换为.mp3

    sox input.wav -c 2 -C 128 output.mp3
    

Note: -c 2makes it stereo, -C 128specifies output as 128 kbps MP3

注意: -c 2使其成为立体声,-C 128指定输出为 128 kbps MP3

回答by Slabo

Compiling SOX with Lame and Libmad for Windows http://www.codeproject.com/KB/aspnet/Compiling_SOX_with_Lame.aspx

使用 Lame 和 Libmad 为 Windows 编译 SOX http://www.codeproject.com/KB/aspnet/Compiling_SOX_with_Lame.aspx

回答by Roman Mishin

You can download SoX binaries together with libmad.dll and libmp3lame.dll from http://www.videohelp.com/software/SoX

您可以从http://www.videohelp.com/software/SoX下载 SoX 二进制文件以及 libmad.dll 和 libmp3lame.dll

http://www.videohelp.com/download/sox-14.4.0-libmad-libmp3lame.zip

http://www.videohelp.com/download/sox-14.4.0-libmad-libmp3lame.zip

回答by Lindylex

I have put together the original SoX binary and libmad and libmp3lame from http://code.google.com/p/ossbuild/source/browse/trunk/Shared/Build/Windows/Win32/bin/

我已经将来自http://code.google.com/p/ossbuild/source/browse/trunk/Shared/Build/Windows/Win32/bin/的原始 SoX 二进制文件和 libmad 和 libmp3lame 放在一起

SoX binary for Win32 together with libmad and libmp3lame

Win32 的 SoX 二进制文件以及 libmad 和 libmp3lame

Thanks that was easy. Thanks for sharing this easy solution.

谢谢,这很容易。感谢分享这个简单的解决方案。

回答by russa

for compiling from source:

从源代码编译:

since the the tutorial http://www.codeproject.com/KB/aspnet/Compiling_SOX_with_Lame.aspxis rather dated (and did not work for me with more recent VisualStudio versions):
the SOX project contains ready-to-use Visual Studio projects for compiling SOX and its dependencies/libraries on Windows (e.g. using a Visual Studio Community Edition).

由于教程http://www.codeproject.com/KB/aspnet/Compiling_SOX_with_Lame.aspx已经过时了(并且对我使用了较新的 VisualStudio 版本不起作用):
SOX 项目包含现成的 Visual Studio 项目用于在 Windows 上编译 SOX 及其依赖项/库(例如使用 Visual Studio 社区版)。

The SOX source code repository at SourceForgecontains a directory msvc10(and also msvc9) for compiling SOX and its dependencies with VisualStudio. Detailed instructions for that are in the Readme.txt.

SourceForge的 SOX 源代码存储库包含一个目录msvc10(以及msvc9),用于使用 VisualStudio 编译 SOX 及其依赖项。详细说明在Readme.txt 中

So, for example, for only compiling libmad.dll:

因此,例如,仅用于编译libmad.dll

  • clone SOX repository, e.g. to directory sox-code/
  • 克隆 SOX 存储库,例如到目录 sox-code/
git clone https://git.code.sf.net/p/sox/code sox-code
sox-code/
libmad/
  • open the VisualStudio project file (*.sln) in directory sox-code/msvc10(if needed, change build configuration form Debugto Release)
  • in the Solution Explorer window open context-menu for sub-project LibMadand select Build(or in older VS versions Project OnlyBuild Only LibMad)
  • afterwards the compiled DLL is in sox-code/msvc10/Release(or Debugdepending on the selected configuration)
  • 打开目录中的 VisualStudio 项目文件 ( *.sln) sox-code/msvc10(如果需要,将构建配置表单更改DebugRelease
  • 在解决方案资源管理器窗口中打开子项目的上下文菜单LibMad并选择Build(或在较旧的 VS 版本中Project OnlyBuild Only LibMad
  • 之后编译的 DLL 在sox-code/msvc10/Release(或Debug取决于所选的配置)

tested with VisualStudio 2010 and Visual Studio 2017 CE

使用 VisualStudio 2010 和 Visual Studio 2017 CE 进行测试