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();
}
main 是资源中的 MP3...我收到以下错误: *System.Media.SoundPlayer.SoundPlayer(System.IO.Stream)' 的最佳重载方法匹配有一些无效参数
和
*无法从'byte[]'转换为'System.IO.Stream'
请您参考如下方法:
Microsoft 对此做了很棒的教程!
参见:http://msdn.microsoft.com/en-us/library/windows/desktop/dd562692(v=vs.85).aspx
祝你好运。
