Wp7 windows phone 7 media element not playing stream
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.
精彩评论