HomeProjectsServicesContactus
» Guest
  Sign In     Register    
Projects » CvMCI
Developer : Ritey
Date : 2005-03-27 00:00

» Summary :

Wrapper class for windows MCI api, to play MP3 WAV WMA etc audio files.

» Catagories :


  • Development Status: Stable
  • Operating System: 2000/XP/2003
  • Development Environment: MSVS.NET

» Latest Project Downloads:

Total Download Count For Project : 312
 
CvMCIcvmci.zip
 2005-11-27Source Code2 KbNotes / ChangesMD5:6161cdd913d58bfa432abeddba40132a315 HitsDownload
 

» Project Information :

Class CvMCI

This is a simple wrapper class for controlling the MCI api functions. These functions control the multimedia devices on the system. This class simplifies the most useful of these functions to create a simple interface for playing and controlling audio files.

It will play any format of audio file that your system can. EG MP3, WAV, WMA.

Methods:

::Open()
Open a device and loads an audio file into it.
*file is the full path to the file to load.

::Close()
Closes the audio device, previously opened with ::Open.

::Play()
Starts playing the loaded audio file.
bWait specifies whether to wait for the audio file to finish playing before returning.
hWndNotify if not NULL specifies a window to send a MM_MCINOTIFY mesasge. The wParam contains the notification reason it can be one of the following MCI_NOTIFY_ABORTED; MCI_NOTIFY_FAILURE; MCI_NOTIFY_SUCCESSFUL; MCI_NOTIFY_SUPERSEDED. The lParam contains the device ID.

::Stop()
Stops the playing.

::Pause()
Pauses the playing.

::Resume()
Resumes the paused audio.

::Seek()
Seeks to a position in the current audio file. dwPos specifies the position in milliseconds to seek to.

::GetStatus()
Returns the current status mode of the MCI device.

::GetLength()
Returns the total length of the audio file in milliseconds. Or 0xffffffff on error.

::GetPos()
Returns the current postion of the audio file in milliseconds. Or 0xffffffff on error.

::GetFile()
Returns a pointer to the saved filename of the audio file. Or NULL on error.

::GetDeviceID()
Returns the current DeviceID of the mci device or 0 if no device is open.


Sample Usage:
Code:
#include "vMCI.h"

void main( void ) {
    CvMCI mci;

    mci.Open("mytrack.mp3");
    mci.Play(1,0);
    mci.Stop();
    mci.Close();

}

The above sample will load an mp3 file called mytrack.mp3 and play it.
0 member(s), 14 guest(s)
| Site Map | Statistics | Terms of Use | Privacy Policy |
Copyright (C) GoCoding.Com 2004-2007
Powered by Seditio
Contacts