Library tutorials & articles

Build an MP3 Player

Introduction

At this late date, you don't need us to tell you that the MP3 file format is big. Chances are, at one point, you even considered coding your own Visual Basic MP3 player. If cost isn't a factor, a multitude of available options exist to do so. Several companies like Dialog-Medien provide ActiveX controls that play MP3 files. As an alternative, you could also write a program that remotely controls another application like the popular WinAmp MP3 player. However, if you have an up-to-date version of Windows Media Player, you already have a freely available solution.

Even given the relatively easy programming interface provided by Windows Media Player, deciphering information included in an MP3--such as the song title and artist's name--can take a little extra work. In this article, we'll not only show you how to use the Windows Media Player to build an MP3 player like the one displayed in Figure A, but we'll also show you how to decode important MP3 tag information.

Figure A: The Windows Media Player provides Visual Basic programmers with free, easy access to MP3 files.

What you'll need

In order to use Media Player to play MP3 files in Visual Basic, you'll need version 5.2 or later (the Microsoft Web site www.microsoft.com/windows/windowsmedia/en/download/default.asp contains version 6.4 and 7.0). You add the Media Player OCX to a project just like any ordinary OCX component.

Comments

  1. 25 Aug 2009 at 02:30

    What version of VB are you running in order to rpoduce this player? I am running VB6 at the moment and cannot compile this player, any chance of rewriting the script for Vb6 for me please as i am only new to Vb and still trying to learn.

    Thanks, Jameson

  2. 24 Dec 2009 at 13:55

    I tried running this but with no succes. "Object does not support this property or method" and this is highlighted: Min = MediaPlayer1.currentPosition * 60.

  3. 24 Dec 2009 at 14:08

    again this is highlighted and i get the same message MediaPlayer1.FileName = FileName

  4. 24 Dec 2009 at 14:16

    now i got it, i'm using a different WMP, my version is 11. so FileName becomes URL and now i need to find a substitute for Currentposition and duration. Thanks for the Tutorial

  5. 25 Dec 2009 at 07:26

    Emicsoft DVD Ripper for Mac,the best Mac DVD ripper, is a professional DVD Ripping software for Mac users to convert and rip DVDs to Mac video formats and portable devices as iPod, iPhone, PSP,PS3,Blackberry etc. The powerful DVD ripper for Mac is perfect in converting/ripping DVD to FLV Mac, DVD to DivX Mac, DVD to MPEG Mac, DVD to MKV Mac, DVD to AVI Mac, DVD to MP4 Mac etc. If you want to rip DVD to other video on Mac,Emicsoft DVD Ripper for Mac is a wonderful tool to help you Rip DVD Mac. [img]http://www.emicsoft.com/images/1.gif[/img] Let’s explore its powerful functions one by one: 1. Support outputting all video/audio formats such as AVI, MPEG-4, H.264/MPEG-4 AVC, MPEG-1, MPEG-2, MOV, MKV, FLV, 3GP, MP3, WAV, WMA, etc. 2. Work for popular devices: iPod, iPhone, Zune, PSP/PS3, Xbox, Wii, Pocket PC, mobile phone. 3. DVD 5 and DVD 9 supported. 4. Capture good pictures when previewing added video. 5. Reset start time and end time to extract certain segment of the file. 6. Alter video aspect ratio or apply zoom mode: full screen, 16:9 and 4:3. 7. Adjust video output effect including Brightness, Contrast, Saturation and Volume. 8. Deinterlacing function can eliminate mosaic on the movie. 9. Plentiful output profile settings and create new profile supported.

    Click http://www.emicsoft.com/dvd-ripper-for-mac.html to get more information.

Leave a comment

Sign in or Join us (it's free).

ElementK Journals

Related discussion

Related podcasts

Want to stay in touch with what's going on? Follow us on twitter or Facebook!