c++ mp3 library [closed]

戏子无情 提交于 2019-12-05 04:12:59
karlphillip

There are a couple of options:

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.

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:

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;

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

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

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).

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

Have you looked into LAME? Also, note that the mp3 algorithm is subject to patents, so you need to tread carefully no matter which library you use.

I think last time i needed i used libMAD. Worked well but it's a C lib.

FaustIMetal

You could try Helix.

It has an optimized version for embedded platforms and arm architectures.

Take a look at bass:

I have worked with it some years ago, it was easy to use, multiplatform, with a good sound quality and the developer was very supportive. It is free for non-commercial use.

I guess that the gstreamer is a best choice but you could also use the LibVLC which is a core of vlc player.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!