Wp7 Windows Phone 7 媒体元素不播放流
我一直在尝试使用媒体元素从 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想使用
Microsoft Translator
,您可以将服务引用
添加到API SOAP 服务。服务客户端公开 SpeakAsync 方法,该方法将返回 <代码>WAV 文件。然后,您可以使用WebClient
或HttpWebRequest
下载流并播放。这篇博客文章<中有示例代码/a>.If you want to use
Microsoft Translator
, you can add aService Reference
to the API SOAP service. The Service Client exposes the SpeakAsync method which will return the URL of theWAV
file. You can then use yourWebClient
orHttpWebRequest
to download the stream and play it. There's example code in this blog post.