本文介绍了播放声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在PlaySound上找到了相关信息。我在我的程序中实现了它 只是花花公子。唯一的小问题是我必须打包 ..wav文件并发送它们,因为PlaySound播放声音文件。 其中一个选项我在PlaySound的一个很好的描述中发现, 还有其他几种选择。 1)声音可以在注册表中实际控制/选择 最终用户。 2)声音也可以嵌入到组件中,只要我可以指向 到包含声音的区域。 我不知道如何设置特定 应用程序的声音注册表。无论如何,wav文件必须安装在用户的 机器的某个地方,所以这似乎不是一个很好的方法。如果它是相当简单的话,我可能会这样做。 最好的似乎是以某种方式将wav嵌入应用程序并播放 内存中的副本。我的问题在于我不知道如何将wav的 内容放入应用程序中的可引用内存 位置。而且我不知道是否需要转换,因为我带来了 。文件中必须有一些提示,例如,多长时间 wav是。或者它可能是自定义的终止字节 序列 - 可能是全0或全Fs字。没有任何线索。 对后两种可能性的任何帮助都将不胜感激! 问候, OtI found information on PlaySound. I implemented it in my program and itworks just dandy. The only little problem is that I have to package the..wav files and send them along since PlaySound plays a sound file.One of the options I found in a nice description of PlaySound says thatthere are a couple of other choices.1) The sound can be in the registry and actually controlled/selected bythe end user.2) The sound can also be embedded in the assembly as long as I can pointto the area containing the sound.I have no clue as to how to set up the registry for sounds for a particularapplication. The wav files have to be installed somewhere on the user''smachine anyway, so this doesn''t seem a really great way to go. If it isfairly simple I might do it anyway.The best seems to be to embed the wav in the application somehow and playthe in-memory copy. My problem here is I have no idea how to get thecontents of the wav into the application at a referenceable memorylocation. And I don''t know if there is any conversion required as I bringit in. There must be some hint in the file as to, for example, how longthe wav is. Or maybe it is self defining with a termination bytesequence -- maybe an all 0s or all Fs word. No clue.Any help on the latter two possibilities would be appreciated!Regards,Ot推荐答案 参见: < http://groups.google.com/groups?selm = exQuKMjfDHA.1712%40TK2MSFTNGP11.phx.gb l> - Herfried K. Wagner [MVP] < http://www.mvps.org/dotnet>See:<http://groups.google.com/groups?selm=exQuKMjfDHA.1712%40TK2MSFTNGP11.phx.gb l>--Herfried K. Wagner [MVP]<http://www.mvps.org/dotnet> 这篇关于播放声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!