Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play mp3 file in c++? [closed]

Tags:

c++

mp3

I'm looking for the easiest way to play an MP3 file in C++. Either a library I could use and just call the function, given the filename, or alternatively something someone has already written that will just run and quit.

like image 967
AsithaL Avatar asked Jan 19 '11 06:01

AsithaL


2 Answers

What platform are you on? You can check these out:

In case of windows/linux:
FMOD

In case you are programming only on windows/mac osx:
BASS

I would also look for some native APIs in Windows (if you are developing on that platform).
HTH,
Sriram

like image 134
Sriram Avatar answered Oct 06 '22 20:10

Sriram


Qt comes to the rescue (again). The documentation even comes with demo code on how to implement a media player. It can play videos as well, btw.

http://doc.qt.nokia.com/latest/demos-qmediaplayer.html

Works on all platform and with the same syntax = WIN.

like image 3
Dat Chu Avatar answered Oct 06 '22 21:10

Dat Chu