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
sox FAIL util: Unable to load MAD decoder library (libmad) function "mad_stream_buffer"
提问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 的步骤:
- Download latest version of SOXand install.
- Download
libmad-0.dll
andlibmp3lame-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. - Add
libmad-0.dll
andlibmp3lame-0.dll
to the folder where SOX was installed to. Use the command line to convert a file to
.mp3
:sox input.wav -c 2 -C 128 output.mp3
- 下载最新版本的SOX并安装。
- 下载
libmad-0.dll
和libmp3lame-0.dll
。目前唯一已知的值得信赖的来源是ossbuild,但这需要您下载 1.5 GB 的存档。此处和此处提供了所选的两个文件。 - 将
libmad-0.dll
和添加libmp3lame-0.dll
到安装 SOX 的文件夹中。 使用命令行将文件转换为
.mp3
:sox input.wav -c 2 -C 128 output.mp3
Note: -c 2
makes it stereo, -C 128
specifies 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 Eugene Oleinik
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 放在一起
回答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
- download
libmad
source code from SourceForgeand decompress to directorylibmad/
(cf. instructions of the SOX VisualStudio Readme.txt, see link above), i.e. the directory structure should look like
libmad
从 SourceForge下载源代码并解压到目录libmad/
(参见 SOX VisualStudio Readme.txt 的说明,参见上面的链接),即目录结构应如下所示
sox-code/
libmad/
- open the VisualStudio project file (
*.sln
) in directorysox-code/msvc10
(if needed, change build configuration formDebug
toRelease
) - in the Solution Explorer window open context-menu for sub-project
LibMad
and selectBuild
(or in older VS versionsProject Only
→Build Only LibMad
) - afterwards the compiled DLL is in
sox-code/msvc10/Release
(orDebug
depending on the selected configuration)
- 打开目录中的 VisualStudio 项目文件 (
*.sln
)sox-code/msvc10
(如果需要,将构建配置表单更改Debug
为Release
) - 在解决方案资源管理器窗口中打开子项目的上下文菜单
LibMad
并选择Build
(或在较旧的 VS 版本中Project Only
→Build Only LibMad
) - 之后编译的 DLL 在
sox-code/msvc10/Release
(或Debug
取决于所选的配置)
tested with VisualStudio 2010 and Visual Studio 2017 CE
使用 VisualStudio 2010 和 Visual Studio 2017 CE 进行测试