DOS MP3 player programming

chibicitiberiu

New Member
I need to make a MP3 Player for DOS, but I don't really know how to read .mp3 files and output the sound to the sound card in c++. Can anyone help me?

All I found interesting on google was this:
http://visumod.freeshell.org/mp3player/mp3player.html
(the executable worked fine, but Turbo C generated some errors when trying to compile the source code because I don't have all the included files)

But the problem is that it's too complicated, it depends on windows, and has too many features. All I need is to play the MP3 file, nothing else, not even pause playback or stop. Can anyone help me?
 
Last edited:
I need to make a MP3 Player for DOS, but I don't really know how to read .mp3 files and output the sound to the sound card in c++. Can anyone help me?

All I found interesting on google was this:
http://visumod.freeshell.org/mp3player/mp3player.html
(the executable worked fine, but Turbo C generated some errors when trying to compile the source code because I don't have all the included files)

But the problem is that it's too complicated, it depends on windows, and has too many features. All I need is to play the MP3 file, nothing else, not even pause playback or stop. Can anyone help me?

Try Visual C++, his source code might be built around Visual Studio. And if it has too many features then strip the code for them out.
 
Try Visual C++, his source code might be built around Visual Studio. And if it has too many features then strip the code for them out.

I want this to work on DOS (borland C++ compiler), Visual C++ is for windows.
What I'm missing is these two files:
Code:
#include <afx.h>
#include <mmsystem.h>

Another problem is that I don't quite understand the code and I'm not that advanced to strip it, that's the problem and I'm looking just for a very basic mp3 player code to learn from it.

I want to learn classes, programming with objects and communicating with devices, because I don't really know anything about them. After learning maybe I will be able to make my own program. Also, I need to know how to decode the MP3 files which doesn't sound like the easiest job.
 
Can you package up the source code, attach it here and possibly label any parts you don't understand?

Also, how are you going to output the sound? Sound drivers don't exactly exist in DOS. Do you assume sound blaster compatible?
 
Last edited:
MPXPLAY looks quite interesting. The mp3player code uses MFC stuff.

http://www.cppdoc.com/example/mfc/classdoc/MFC/AFX.H.html here is afx.h

http://doc.ddart.net/msdn/header/include/mmsystem.h.html you may also need http://doc.ddart.net/msdn/header/include/pshpack1.h.html for mmsystem.

I would run with mpxplay, it looks like a much more complete package.

Okay, I have just tested them in a virtual machine, and the only working one was MPX, and the coolest thing: I didn't need to install any drivers.
 
Last edited:
When you don't use drivers I think MPX emulates a SB16 (most sound cards are compatible with this format). You lose other features of your sound card in this mode though.
 
When you don't use drivers I think MPX emulates a SB16 (most sound cards are compatible with this format). You lose other features of your sound card in this mode though.

Anyway, the sound is great for such an old OS. I like it and I thing I'm going to use it in some of my programs written in C++ in 16-bit mode.
 
Back
Top