This class can directly play mp3 files
Usage:
ClsMCI cm = new clsMCI ();
Cm. FileName = "let alone I am a goat ";
Cm. play ();
Class Code
Using System;
Using System. Runtime. InteropServices;
Using System. Text;
Using System. IO;
Using System. Windows. Forms;
Namespace WindowsApplication7
{
/// <Summary>
/// Summary of clsMci.
/// </Summary>
Public class clsMCI
{
Public clsMCI ()
{
//
// TODO: add the constructor logic here
//
}
// Define the string variable used by the API Function
[Financialas (UnmanagedType. ByValTStr, SizeConst = 260)]
Private string Name = "";
[Financialas (UnmanagedType. ByValTStr, SizeConst = 128)]
Private string durLength = "";
[Financialas (UnmanagedType. LPTStr, SizeConst = 128)]
Private string TemStr = "";
Int ilong;
// Defines the enumerated variables of the playback status.
Public enum State
{
MPlaying = 1,
MPuase = 2,
MStop = 3
};
// Structure Variable
Public struct structMCI
{
Public bool bMut;
Public int iDur;
Public int iPos;
Public int iVol;
Public int iBal;
Public string iName;
Public State state;
};
Public structMCI mc = new structMCI ();
// Obtain the playback file attributes
Public string FileName
{