MCIERR_INTERNALI 正在尝试在应用程序中制作一个简单的媒体播放器,但我注意到我的代码不会播放音乐,除非文件是 192kbps 或更低的低比特率。问题是我的大部分音乐都在 260-320kbps 左右。
这是我的代码,如果我可以做些什么来提高“可用”比特率选项,请告诉我,否则我需要一个新的 DLL 建议!
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);
}
}
**编辑:-Winform 应用程序
- 使用 Windows 7 sp1
- 使用 Visual Studio 2013 社区版
-从错误捕获我现在看到错误号是 289,-256 = 22: MCIERR_INTERNAL,不知道这是怎么回事