开发者

Wp7 windows phone 7 media element not playing stream

开发者 https://www.devze.com 2023-03-12 10:07 出处:网络
i have been trying to play some sound(.wav) from a website link on windows phone 7 using the media element.

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();

doe开发者_高级运维snt 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号