Windows mp3解码库c c ++ [英] windows mp3 decode library c c++

查看:212
本文介绍了Windows mp3解码库c c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经花了一整天了,这让我发疯了

I've spent all day on this and its driving me nuts

有人知道将mp3解码为简单的16位pcm(波形)文件的简单方法吗?我需要我的商业程序可以附带的东西,所以我更喜欢.lib

Does someone know a simple way to decode an mp3 to a simple 16 bit pcm (wave) file? i need something i can ship with my commercial program so i prefer a .lib

我找到了libmpg123.dll,但是我不知道如何使我的程序与msvc 2010中的dll链接.我知道我需要添加一个引用,但是当我单击添加新引用"时,我得到的就是一个空对话框,其中包含项目名称"和项目目录"标题,无需单击任何内容.我尝试使用lib工具将.dll转换为.lib,但这一直抱怨.def文件格式不正确.

I found libmpg123.dll but i can't figure out how to get my program to link with a dll in msvc 2010. i know i need to add a reference but when i click 'add new reference' all i get is a empty dialog with Project Name and Project directory heading and nothing to click. I tried converting .dll to .lib using the lib tool but that keeps complaining the .def file format is bad.

我试图构建madplayer,但是我无法对id3tag.h进行优化,也没有找到关于使用libmad的文档或示例

I tried to build madplayer but i can't fine id3tag.h and there is no documentation or examples about using libmad that i can find

Lame看起来太大了

Lame looks too huge

任何有关.lib的快速解决方案的想法,我都可以与之链接并完成

Any ideas for a quick solution for a .lib i can link with and be done with it

谢谢,史蒂夫

推荐答案

mpg123 很好.我可以看到您在获取静态库(.lib)时遇到了麻烦.

mpg123 is fine. I can see you have troubles with getting static library (.lib).

有两种获取lib的方法:

There are 2 ways to get the lib:

  1. 构建源代码.它要灵活得多,但是有点棘手.如果下载源,则可以通过以下路径找到VS2010的端口:ports \ MSVC ++ \ 2010.但是在这种情况下,您将面临安装 YASM 并使用构建配置的问题(似乎配置不是在源代码包中进行了适当调整).
  2. 通过转换.def文件使用lib工具.您不需要源文件,因为二进制软件包已经包含.h和.def文件.我将详细解释:

  1. Build the source code. It's much more flexible, but it's a bit tricky. If you download the sources, you can find a port to VS2010 by the path: ports\MSVC++\2010. But in this case you will face with issues of installing YASM and playing around with build configurations (seems the configurations are not properly adjusted in the source code package).
  2. Use the lib tool by converting the .def file. You don't need sources as the binary packages already contain the .h and the .def files. I will explain in details:

  1. 下载二进制文件( win32
  1. Download the binaries (win32 or win64) and extract let's say to D:\mpg123 folder.
  2. Run from Start -> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010).
  3. Go to your folder cd D:\mpg123, D: and run the line: lib /def:libmpg123-0.dll.def (or however the def file is called).
  4. Now you have the desired .lib file libmpg123-0.dll.lib in your folder.

但是请注意,框架和引用"属性页用于设置对.NET Framework程序集,COM组件或外部项目的引用(

But notice, that the 'Framework and References' property page is used to set references to .NET Framework assemblies, COM components, or external projects (MSDN), in your case you should specify additional linker dependency in your project [Configuration Properties => Linker => Input => Additional Dependencies].

这篇关于Windows mp3解码库c c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆