Wp7 Windows Phone 7 媒体元素不播放流

发布于 2024-11-15 04:09:52 字数 328 浏览 7 评论 0原文

我一直在尝试使用媒体元素从 Windows Phone 7 上的网站链接播放一些声音(.wav)。

MediaElement mediaElement = new MediaElement(); mediaElement.source = new uri("http://api.microsofttranslator.com%2fwav"); mediaElement.play();

不做任何事情。

我尝试实现处理程序,甚至尝试使用 Webclient 类下载流并播放它,但它有同样的问题,我没有听到任何声音。

我还将 uri 复制到浏览器,它播放了我需要的波形。

i have been trying to play some sound(.wav) from a website link on windows phone 7 using the media element.

MediaElement mediaElement = new MediaElement();
mediaElement.source = new uri("http://api.microsofttranslator.com%2fwav");
mediaElement.play();

doesnt do anything.

i tried implementing handlers or even try to use the Webclient class to download the stream and play it but it has the same problem i dont hear anything.

and also i copied the uri to the browser and it played the wave i needed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自此以后,行同陌路 2024-11-22 04:09:52

如果您想使用Microsoft Translator,您可以将服务引用添加到API SOAP 服务。服务客户端公开 SpeakAsync 方法,该方法将返回 <代码>WAV 文件。然后,您可以使用 WebClientHttpWebRequest 下载流并播放。这篇博客文章<中有示例代码/a>.

If you want to use Microsoft Translator, you can add a Service Reference to the API SOAP service. The Service Client exposes the SpeakAsync method which will return the URL of the WAV file. You can then use your WebClient or HttpWebRequest to download the stream and play it. There's example code in this blog post.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文