媒体播放器没有播放超过192比特率的MP3文件? [英] media player not playing more than 192 bit rate MP3 files?

查看:120
本文介绍了媒体播放器没有播放超过192比特率的MP3文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在google上搜索并找到播放mp3文件的代码,但问题是当文件(.mp3)b 它的速率超过192kbps时文件无法播放

我的代码(我在谷歌上找到): -



Hi,
I searched on google and find code to play mp3 files, but the problems is when the files(.mp3) bit rate is more than 192kbps file not play.
My code is(which i found on google) :-

[DllImport("winmm.dll")]
       private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwndCallback);
       public bool open(string file)
       {
           if (!File.Exists(file))
               return false;
           string command = "open " + file + " type MPEGVideo alias MyMp3";
           mciSendString(command, null, 0, 0);

           return true;
       }

       public void play()
       {
           string command = "play MyMp3";
           mciSendString(command, null, 0, 0);
       }

       public void stop()
       {
           string command = "stop MyMp3";
           mciSendString(command, null, 0, 0);

           command = "close MyMp3";
           mciSendString(command, null, 0, 0);
       }





我需要在媒体播放器中播放所有比特率文件,

所以如何在C#中播放超过192kbps的比特率文件(mp3)



I need to play all bit rate file in my media player,
so how to play more than 192kbps bit rate files(mp3) in C#??

推荐答案

试试把 [STAThread] 在您的应用程序的主要方法之上,如下所示:

Try put [STAThread] above the main method of your application, like this:
[STAThread]
static void Main(string[] args) {
...



祝你好运!


Good luck!


这篇关于媒体播放器没有播放超过192比特率的MP3文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆