Ali baba
Ali baba

Reputation: 97

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

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.

Upvotes: 0

Views: 1005

Answers (1)

keyboardP
keyboardP

Reputation: 69372

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.

Upvotes: 1

Related Questions