c ++ mp3库 [英] c++ mp3 library

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

问题描述

我疲于寻找一个c ++ mp3解码库,最好是免费的(如lgpl)和跨平台或Windows和mac。任何人都可以建议这样的图书馆和post一些教程使用它?
ffmpeg和sdl(sdl_sound,sdl_mixer)不编译。我无法得到mpg123工作 - 是为linux世界还是什么?有没有一些教程在Windows上使用mpg123? mpg123找不到一些符号,我不是把一些dll在正确的路径 - 但是?

I am exhausted searching for a c++ mp3 decoding library, preferably free (like lgpl) and cross-platform or for windows and mac. Can anyone suggest such library and post some tutorial for using it? ffmpeg and sdl (sdl_sound, sdl_mixer) aren't compiling. I am unable to get mpg123 working - is it for linux world only or what? Is there some tutorial on using mpg123 on windows? mpg123 is unable to find some symbols that is I am not putting some dll's at right path - but which?

总的来说,我想能够读取和写入所有主要音频Windows和Mac上的文件格式 - 从Windows开始。

Overall, I want be able to read and write all major audio file formats on windows and mac - starting with windows.

推荐答案

有以下几种选择:


GStreamer 是用于构建媒体处理组件图形的跨平台库。它支持的应用范围从简单的Ogg / Vorbis播放,音频/视频流到复杂的音频(混合)和视频(非线性编辑)处理。

GStreamer is a cross-platform library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.

本页在GStreamer和MP3格式上有一些非常有趣的信息,如果你决定使用GStreamer,那么它是必须阅读的:

This page has some very interesting info on GStreamer and the MP3 format, it's a must-read if you decide to go with GStreamer:


MP3音频格式是一种痛苦。它是专利保护,使得Linux分销商难以在世界各地合法地封装(或Linux用户使用)。它甚至听起来不错,相比一些替代品。但是MP3很难避免;

The MP3 audio format is a pain. It is patent-encumbered, making it hard for Linux distributors to package (or Linux users to use) legally in various parts of the world. It doesn't even sound all that good, compared to some of the alternatives. Yet MP3 is hard to avoid;

除此之外,Gstreamer通过 gst-launch 这对于测试您在程序中组装的管道非常有用,然后开始编写代码实际代码:

Besides that, Gstreamer ofers a command-line interface through gst-launch which is very useful to test the pipeline you are assembling in your program before you start to write code the actual code:

gst-launch filesrc location=/path/to/audiofile ! decodebin ! oss4sink

如果您需要在Windows上构建GStreamer ,请查看此教程对于Visual Studio

And if you need to build GStreamer on Windows, check this tutorial for Visual Studio.


PortAudio 是一个免费的跨平台开源音频I / O库。它允许您编写简单的音频程序在C或C ++,将编译和运行在许多平台,包括Windows,Macintosh OS X和Unix(OSS / ALSA)。

PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA).

MP3支持通过 libmad 发布。有教程可帮助您创建和使用图书馆。

The MP3 support comes through libmad. There are tutorials that help building and using the library.

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

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