C#在后台播放声音

编程入门 行业动态 更新时间:2024-10-27 16:33:38
本文介绍了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#在后台播放声音

本文发布于:2023-11-27 03:20:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636357.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后台   声音

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!