Important alert: (current site time 7/15/2013 6:45:13 PM EDT)
 

winzip icon

MP3 Decoder/Playback Source

Email
Submitted on: 4/23/2000 9:28:09 AM
By: Jonathan Smith  
Level: Advanced
User Rating: By 30 Users
Compatibility: C, C++ (general)
Views: 63130
author picture
(About the author)
 
     This code demonstrates how MPEG-Layer 3 (MP3) files are read by programs like WinAmp and Windows Media Player. Note this code uses no Windows API calls, DLLs, or OCXs. This is the *RAW*, *VERY UNREFINED* CODE for reading and playing MP3s. It contains no examples, but is based on FreeAmp, so if you want an example, FreeAmp is as close as you're going to come. I do plan on creating an example sometime later on, but for now, here's the code that everyone's wanted. =) I can't take credit for this code, though. The ORIGINAL MP3 decoding algorithms were written by the Fraunhaufer Institute. Oh yeah, while I'm at it, vote for me! =)
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/12/2000 4:42:25 PMetrask

I have the Xing MP3 player. It rocks. It came with AudioCatalyst and an MP3 editor. Good code!
(If this comment was disrespectful, please report it.)

 
1/2/2001 10:00:38 AMNeil Ramsbottom

Please retain the direcotry structure when you zip files up.

I cant compile this because I need C:\config\config.win32 and c:\config\res
, etc
(If this comment was disrespectful, please report it.)

 
3/27/2001 3:43:25 PMPuzzle

Hi i tried to decode mp3 on my laptop . It did not work. But it works on my desktop.Why
(If this comment was disrespectful, please report it.)

 
4/12/2001 4:02:00 PMMenion

I have had problems with his morphyx wrapper source. I emailed him through PSC but no response yet. When you manually change to a higher bitrate than 128, it encodes 2x the speed or more. Wondering if it was an error in his c code or if it was something else. If anyone else has run into this, lemme know please...THANKS!
(If this comment was disrespectful, please report it.)

 
5/4/2001 4:55:51 AMmehrunnisa

Sir Ultimatum

when i tried to run this code there were some header files missing.so i couldn't run it. there were 25 errors of that "unable to include files".
Actually i m also trying to develop a mp3 player so i need your help.i couldn't find any source code of mp3 decoder that could run properly.each gives errors and same problem is with this decoder.

can u help me . i need your response plz mail me if u can help me at:
mehrunnisa5@yahoo.com

thanks a lot

Mehr-un-Nisa
Mcs
Fatima Jinnah Women University
Pakistan.

(If this comment was disrespectful, please report it.)

 
12/25/2001 6:25:37 PMSimon Mallett

This code only "sucks" to those who cant decipher it, i admit its fairly cryptic but if ya take ya time over learning the base ideas of the MPEG layer III format then you would understand it.. Sorry if im going off on one but I get fed up with Newbies who complain at code they dont understand plainly because it isn't as strait forward as PlayMp3Func()... BTW VERY interesting code :)
(If this comment was disrespectful, please report it.)

 
12/31/2001 11:01:09 PMMattuu

Could someone please fix for Visual c++ 6.0 and send to my email address mattuu@hotpop.com please .. I have tried everything and it just gives me
(If this comment was disrespectful, please report it.)

 
5/11/2002 1:28:58 PManmol bhasin

dear ultimatum sir,
i am trying to develop an mp3 player and need guidance,can you help me please
(If this comment was disrespectful, please report it.)

 
1/19/2003 11:48:24 AM

can you give me full code for a mp3 player or mpeg player or avi player..
plssss..............

(If this comment was disrespectful, please report it.)

 
1/22/2003 11:48:30 AM

what's config.h?? and can someone plz help me! i always download source codes and i find lots of them!! which one shall i compile?!
(If this comment was disrespectful, please report it.)

 
1/25/2003 9:57:35 PM

please give me the code
(If this comment was disrespectful, please report it.)

 
2/17/2003 11:42:03 PM

i tried to compile it but, i just have received a error message, that says:
resource compiler error
cannot open file: resource.h, or am i doing something wrong??, i tried to run it by using borland c++ v. 5.6 is it ok?? or should i use another program??
is it ok to try to run xing.rc??? please help me.
(If this comment was disrespectful, please report it.)

 
2/17/2003 11:44:18 PM

i wrote the last message my e-mail is vilapur999@hotmail.com
(If this comment was disrespectful, please report it.)

 
7/14/2003 2:39:42 AM

I cant compile this because I need
X:\config\config.win32 and X:\config\res,etc
hope u can help me,THANKS
(If this comment was disrespectful, please report it.)

 
7/14/2003 2:41:08 AM

I wrote the last message my e-mail is
myjeric@hotmail.com
(If this comment was disrespectful, please report it.)

 
7/15/2003 10:47:31 PMFaero

I wrote the last message my email is

brennan@klikw.com
(If this comment was disrespectful, please report it.)

 
8/16/2003 11:48:06 AMFaero

Hi when i wrote the message before this one, i meant i wrote the LAST (final) message. not the one before it! bye!
(If this comment was disrespectful, please report it.)

 
7/29/2004 6:41:20 AMSebBloods

BTW, it is "Fraunhofer", not "Fraunhaufer". ;-)
(If this comment was disrespectful, please report it.)

 
9/12/2006 2:11:17 PMAmit

Hi and thanks! this code is great. i am trying to build an mp3 player. please help at storyera@rediffmail.com
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.