SIGN UP MEMBER LOGIN:    
ARTICLE

Simple MP3 Player

Posted by George Steeves Articles | C# Language November 20, 2006
So many people are asking how to play MP3 and WAV files that I put together this simple player. One button and six lines of code. Thats all there is.
Reader Level:
 

I have often been asked the question " Is there a simple way to play WAV and MP3 files from C#".  I have in the past few days devoted myself to doing this and I have been able to create a simple C# form with a single button to play both MP3 and WAV files using only six lines of code. 

The program utilizes the device control MP3P.OCX which must be registered with regsvr32.exe but I have created "setup.bat" to do this.

There also must be the following .dll files present.

  • AxInterop.MP3PLib.dll
  • Interop.MP3PLib.dll

I have a  mp3player.zip file containing the program which is named

  1. MP3play.exx   This must be renamed
  2. mp3play.exe.  I have done this to facilitate internet transmission.

I also have a zip file mp3play_source.zip with the source code.

 
         

Login to add your contents and source code to this article
share this article :
post comment
 

This code was written in 2002 for Visual 2003 and it does not surprise me that it does not work.  I suggest you download my tutorial which contains much more modern code to play MP3's: Link

Posted by George Steeves Aug 15, 2009

u r the worst developer, issues....................

Posted by sibi Aug 15, 2009

I make mp3p.ocx :) I run program and I have 0 errors But when I open mp3 file music dont play :(

Posted by tompi tompi Nov 25, 2007

Ok... I did have the same problem, can't register mp3p.ocx... later I did find this article 

http://www.c-sharpcorner.com/UploadFile/mgold/PoormansIPod01172007144720PM/PoormansIPod.aspx

 

so maybe you need too the   xaudio.dll    file in the system32 directory to register successfully the mp3p.ocx 

Posted by Victor Jul 01, 2007

I cannot, for the life of me, get "MP3p.ocx" to successfully register. Error message as follows: 'LoadLibrary("MP3p.ocx") failed - The specified module could not be found.' I've tried your batch file, I've tried doing it myself, I even moved it into "%SystemRoot%\system32", to no avail. I can be reached at: fewiii@hotmail.com

Posted by Freddy Apr 01, 2007
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor