Click here to Skip to main content
Click here to Skip to main content

A very simple MP3 Player

, 13 Jun 2001
Rate this:
Please Sign up or sign in to vote.
A simple MP3/AVI player using the VFW32 library
<!-- Download Links --> <!-- Main HTML starts here -->


I made a little sample program that enables you to play MP3 files without needing the AUDIOX library. I used the Windows Library VFW32.Lib

Just put the VFW32.lib in the Linker's space (Alt +F7) and add

#include "vfw.h"

to your principal file.

Once you've done this, you just need to use the MCI commands:

Steps :

  • Create a private variable HWND m_Video and BOOL Pause;

  • in the OnInitDialog set m_Video = NULL;

  • Put almost the Play button and add this source code on

Here are the functions I use in my dialog class to play/pause/resume and stop video playback.

m_Play is the 'Play' button control, m_Pause is the pause/resume button, Pause is a boolean value, and m_Video is a HWND.

void CAVIPlayerDlg::OnPlay() 
	m_Video = NULL;
	if(m_Video == NULL)
		m_Video = MCIWndCreate(this->GetSafeHwnd(),
	Pause = FALSE;

void CAVIPlayerDlg::OnPause() 
		Pause = FALSE;
		Pause = TRUE;

void CAVIPlayerDlg::OnCancel() 
	if(m_Video !=NULL)

void CAVIPlayerDlg::OnStop() 
	// TODO: Add your control notification handler code here
	if(m_Video !=NULL)

I Suggest you to refer to the MCI Reference on the net at

I also include an AVI player in this program. Smile | :)

That's all for this !


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author


United States United States
My name is BLaZe and I have 15 years old

Comments and Discussions

GeneralGreat Program Pinsusssk-i-za7-Aug-02 8:38 
GeneralHolds on to previous file Pinmembercodermallu1-Aug-02 4:58 
GeneralRe: Holds on to previous file Pinsussoqnet19-Apr-05 15:29 
GeneralCodecs required PinmemberArmen Hakobyan22-Jul-02 17:40 
Generalplay avi files in .net environment Pinmemberlinus lee20-May-02 23:16 
GeneralChanging soundcards. PinmemberLargie2-Mar-02 1:51 
GeneralRe: Changing soundcards. PinmemberBLaZiNiX2-Mar-02 7:04 
GeneralRe: Changing soundcards. PinmemberLargie3-Mar-02 22:04 
I have found a Windows Mediaplayer EULA SDK, but it did not make me any wizer! Wink | ;)
The SDK is pretty straight forward, but it uses only the primary directsound object (COM) and sends the "sound" to it.
I have not found any option in the media player (normal use) to change the output card, either than using the "Multimedia" option in the "Control Panel". But it changes the soundcard for every playback.
Dead | X|
Lars Werner , aka Largie

GeneralRe: Changing soundcards. PinmemberGuitool30-Jul-02 1:22 
GeneralGood for beginner PinmemberLIK27-Feb-02 7:17 
GeneralCant compile it :( Pinmemberantivoid5-Jan-03 0:37 
GeneralI like it:) PinmemberMazdak20-Feb-02 4:52 
Generalto handle mci_stop message PinmemberJaggu13-Dec-01 12:11 
GeneralMp3 player PinmemberJarek Gibek7-Sep-01 3:18 
GeneralRe: Mp3 player PinmemberAnonymous10-Mar-02 15:38 
GeneralBook PinmemberBrian Hart15-Jun-01 6:07 
GeneralRe: Book PinmemberAnonymous19-Jun-01 7:04 
GeneralNot an MP3 player PinmemberAnonymous14-Jun-01 7:20 
GeneralRe: Not an MP3 player PinmemberLOXmith21-Jun-01 22:25 
GeneralRe: Not an MP3 player Pinmemberzrsoft16-Dec-01 5:36 
GeneralRe: Not an MP3 player PinsussAnonymous21-Jul-02 16:03 
GeneralRe: Not an MP3 player PinmemberChristian Graus21-Jul-02 16:30 
Generalagree. It is not the code that i expect. Pinmembersodic29-Jun-02 11:36 
GeneralGood job for 15 years old PinmemberBrian V Shifrin14-Jun-01 6:30 
GeneralRe: Good job for 15 years old PinmemberBLaZe14-Jun-01 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150123.1 | Last Updated 14 Jun 2001
Article Copyright 2001 by BLaZe
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid