c++ mp3 library [closed]

2020-08-22 06:46发布

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?

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

标签: c++ ffmpeg mp3
6条回答
Summer. ? 凉城
2楼-- · 2020-08-22 07:06

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

查看更多
Deceive 欺骗
3楼-- · 2020-08-22 07:09

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.

查看更多
一夜七次
4楼-- · 2020-08-22 07:10

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.

查看更多
老娘就宠你
5楼-- · 2020-08-22 07:10

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

查看更多
Juvenile、少年°
6楼-- · 2020-08-22 07:15

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.

查看更多
太酷不给撩
7楼-- · 2020-08-22 07:20

You could try Helix.

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

查看更多
登录 后发表回答