Click here to Skip to main content
16,016,789 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
"i want to play mp3 file using c++"
but i need simple coding to do this
i dont want to play mp3 using existing players i.e i want a mp3 file to be played independent of any player
please help me in this im searching for this and not able to find suitable text
"i have searched free source code but i find it difficult to understand"
Posted

Look up on how to use the OGG library. It's open source and in C.
http://vorbis.com/software/[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Mar-11 13:12pm    
OP commented:


again i found it difficult to understand i simpler code.....
Harrison H 10-Mar-11 13:12pm    
Ok. Well if you need it simpler than that, try FMOD.

Look here for an example:
http://stackoverflow.com/questions/428884/how-to-play-mp3-files-in-c

Edit:
And here for the source:
http://www.fmod.org/index.php/download
Sergey Alexandrovich Kryukov 10-Mar-11 13:15pm    
Are you saying Vorbis can play MP3, not just OGG Vorbis? If so, I never knew...
--SA
Harrison H 10-Mar-11 13:21pm    
Yea it can. You just have to be able to load in the raw audio bits. It's pretty versatile. We use it for our cross-platform development framework (ios, android, OSX, Windows, Linux) and openGL for our cross-platform graphics. It's pretty friggin sweet!
Harrison H 10-Mar-11 14:10pm    
Actually sorry about that. I forgot that we use openAL for audio abstraction. Ogg vorbis just provided us with the "raw bits" I was talking about. If the OP's still interested, I'd look into one of the simpler solutions like FMOD.
You can try the MCI functions in the Windows MDK .

The key function is mciSendCommand() and mciSendString.You should check it out by Google or MSDN.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900