MCIERR_INTERNALI trying to create a simple media player inside the application, but I noticed that my code does NOT play music if the file does not have a low transfer rate of about 192 kbps or less. The problem is that most of my music is around 260-320 kbps.
Here is my code, if there is something that I can do for the "available" bitrate options, let me know, otherwise I will need a new DLL suggestion, please!
class MusicPlayer
{
[DllImport("winmm.dll")]
private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwndCallback);
private static void checkMCIResult(long code)
{
int err = (int)(code & 0xffffffff);
if (err != 0)
{
throw new Exception(string.Format("MCI error {0}", err));
}
}
public void open(string file)
{
string command = "open \"" + file + "\" type MPEGVideo alias MyMp3";
checkMCIResult(mciSendString(command, null, 0, 0));
}
public void play()
{
string command = "play MyMp3";
mciSendString(command, null, 0, 0);
}
public void pause()
{
string command = "stop MyMp3";
mciSendString(command, null, 0, 0);
}
}
** EDIT: -Winform application
-using Windows 7 sp1
-Using version of Visulal Studio 2013
-When errors fail, I now see error number 289, -256 = 22: MCIERR_INTERNAL, not sure what this is all about