本文介绍了C#在后台播放声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private System.Media.SoundPlayer sp;
public Form1()
{
InitializeComponent();
sp = new System.Media.SoundPlayer(Properties.Resources.main);
}
private void Form1_Load(object sender, EventArgs e)
{
sp.Play();
}
主要是来自资源的MP3 ...我得到以下错误:* System.Media.SoundPlayer.SoundPlayer(System.IO.Stream)'的最佳重载方法匹配具有一些无效参数
main is a MP3 from resources...I get the following errors: *The best overloaded method match for System.Media.SoundPlayer.SoundPlayer(System.IO.Stream)' has some invalid arguments
和
*无法从"byte []"转换为"System.IO.Stream"
*cannot convert from 'byte[]' to 'System.IO.Stream'
推荐答案Microsoft对此做了很好的教程!
Microsoft do a great tutorial on this!
请参阅: msdn.microsoft/zh-CN/library/windows/desktop/dd562692(v=vs.85).aspx
祝你好运.
更多推荐
C#在后台播放声音
发布评论