如何在 Silverlight 中播放 ogg vorbis 文件?
我想在 Silverlight 中播放来自 http 的 ogg vorbis 音频。我需要什么才能实现这一点?
I'd like to play back ogg vorbis audio from http in Silverlight. What do I need to make this happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
比“Silverlight 不支持 Ogg Vorbis”更好的答案是 Silverlight 不支持本地播放它们。正如其他评论者指出的那样,http://veritas-vos-liberabit.com /monogatari/2009/03/moonvorbis.html,CSVorbis 的当前源代码位于 https://github.com/mono/csvorbis。您确实需要实现 MediaStreamSource 来播放生成的 PCM 流,但这并不是什么复杂的事情。
A better answer than "Silverlight doesn't support Ogg Vorbis" is to say that Silverlight doesn't support playing them natively. As one of the other commenters pointed out, a way to play them is described at http://veritas-vos-liberabit.com/monogatari/2009/03/moonvorbis.html, with the current source for CSVorbis available at https://github.com/mono/csvorbis. You would indeed need to implement a MediaStreamSource to play the resulting PCM stream, but that's not rocket science.
Silverlight 不支持播放 ogg vorbis 文件。
如果您希望 Silverlight 播放已经以 ogg vorbis 编码的文件,我建议对其进行转换。要么对所有文件进行一次性彻底转换,要么在服务器提供服务时即时转换它们。
或者,在 Silverlight 4 中,假设您对媒体格式有足够的了解并且 Ogg vorbis 是特定的,您可以实现 MediaStreamSource 来支持 ogg vorbis。
http://msdn.microsoft .com/en-us/library/system.windows.media.mediastreamsource(VS.96).aspx
Silverlight does not support playing ogg vorbis files.
If you'd like Silverlight to play files already encoded in ogg vorbis, I suggest converting them. Either do a one time sweeping convert of all your files, or convert them on the fly while your server is serving them.
Alternatively, In Silverlight 4, assuming you know enough about Media Formats and Ogg vorbis is particular, you can implement MediaStreamSource to support ogg vorbis.
http://msdn.microsoft.com/en-us/library/system.windows.media.mediastreamsource(VS.96).aspx