Здесь
class Program
{
public string _command;
public bool isOpen;
[DllImport("winmm.dll")]
public static extern long mciSendString(string strCommand,StringBuilder strReturn,int iReturnLength, IntPtr hwndCallback);
static void Main(string[] args)
{
string FileName = @"F:\MUSIC\ROCK.mp3";
string _command = "open \"" + sFileName + "\" type mpegvideo alias MediaFile";
mciSendString(_command, null, 0, IntPtr.Zero);
isOpen = true;
if(isOpen)
{
_command = "play MediaFile";
if (loop)
_command += " REPEAT";
mciSendString(_command, null, 0, IntPtr.Zero);
}
/*For Close the audio
_command = "close MediaFile";
mciSendString(_command, null, 0, IntPtr.Zero);
isOpen = false; */
}
}
CommandString должно быть «play Mediafile» вместо «play Mp3file». Надеюсь, это поможет .. =]