How can i do that ?!
This is a discussion on play MP3 on win32 consol project within the C++ Programming forums, part of the General Programming Boards category; How can i do that ?!...
How can i do that ?!
Do you really think playing MP3s is so trivial? You can call upon other programs to do the playing (as the above line does - it opens your standard media player), but playing an MP3 yourself is not trivial. You need to decode it, and you need to send the decoded data to the soundcard. Complicated.Code:ShellExecute(0, TEXT("open"), path, 0, 0, SW_SHOWNA);
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
I dont want to really read the mp3 file convert it and play it, i just want to add to my application a backround music from mp3 i have.
How do i do that ?
i tried to use ShellExecute, but Visual studio 2005 doesnt reconize it... :\
The matter is complicated. You could do it through an external library or use DirectShow. That's probably the easiest way. There are plenty of sample code on CodeProject to play mp3. Why not give it a look?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
DirectShow is the simplest way to do this short of using a third party library. Keep in mind that DirectShow is no longer a part of DirectX and is available in the Platform/Windows SDK (for XP). They are planning on removing DirectShow completely but I'm not sure if they have or not. They might as well since they already removed everything that is of worth in XP from Vista.
Er, how will the myriad of video players work, then?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
They plan to remove it!? Are they drinking beer again? :/
Where did you originally learn this?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
I learned it way back when I began writing my DXShowWnd class which wrapped DirectShow. At first I thought it odd that it was no longer in the DX SDK. So I found out it was in the Platform SDK and that eventually it would be merged into something completely different in future versions. I'm not sure if that still holds true today.
Microsoft changes fundamental designs in the blink of an eye. Unfortunately those decisions have far reaching impacts and are a pain in my arse.
They are a pain to everyone. Although I wouldn't be sad if they were to upgrade it without the use of COM.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Or you could just make your own background music using system beeps lol. They are featured in the windows library, super easy too! But as he said, it's complicated.