Normally, you can listen to text spoken using the web page here: http://translate.google.com/translate_tts?tl=en&q=HelloWorld
When you view this webpage, you will see a HTML 5 video tag.
If you've tried to use this webpage in a WebBrowser control, this trick won't work. I am also pretty sure that the Internet Explorer in WP7 doesn't support HTML5.
Let's get back to our topic. When you open that website you'll see a video player:

If you're using Google Chrome, when you right-click on that control and click "inspect element" then this is where the Developer Tools will display now.
See the HTML tag there:
| <video controls="" autoplay="" name="media" __idm_id__="772538369"> <source src="http://translate.google.com/translate_tts?tl=en&q=Hell%20World" type="audio/mpeg"> </video> |
It has a source with a type "audio/mpeg" that means we don't need a Webbrowser.
All we need is : MediaElement!
Before we start coding, my page looks like this:


And its XAML:
|
First add a static variable to store the page URL:
|
Then in a button click event write these:
|
Now run it!
Enter something into your Textbox then click the "Speak!" button.
Everything will be working fine.
Hope that helps!

Ibrahim ErsoyPosted Jan 9, 2013, 6:02 AM
@Sam: Thank you! Yes according to the article we can use HTML5 in internet explorer at Mango update.i didnt know that.But playing a sound from a webbrowser control would be a bad idea.
Ibrahim ErsoyPosted Jan 9, 2013, 5:59 AM
your welcome yusuf!
Yusuf KaratoprakPosted Jan 8, 2013, 2:30 AM
Good job ibo !
Sam HobbsPosted Jan 5, 2013, 12:02 PM
Does http://msdn.microsoft.com/en-us/windowsmobile/hh369944.aspx help? It is called "How Do I: Use HTML5 in the WebBrowser Control in Windows Phone ´Mango´?". Also, for Desktop PCs at least we need to specify that a web page uses IE9 features.
Mahesh ChandPosted Dec 9, 2012, 10:26 AM
Got it.
Ibrahim ErsoyPosted Dec 9, 2012, 4:36 AM
Since Windows Phone 8-specific apps wont work in Windows Phone 7 devices,building WP7 apps would be your option.WP7 apps works on both devices.
Ibrahim ErsoyeditedPosted Dec 9, 2012, 4:31 AMEdited Dec 9, 2012, 4:33 AM
in Windows Phone 8 SDK there is a namespace "Windows.Phone.Speech.Synthesizer" and inside this namespace there is a method "SpeakTextAsync" which does the same job i did above.But its only in Windows Phone 8 SDK.Previous one,WP7 SDK doesnt have a speech api like that.Thats why we have to use a Speech Engine like Bing or Google.Since Pavan explained using Bing Speech API here: http://www.c-sharpcorner.com/UploadFile/pavanpareta/text-to-speech-in-windows-phone-7/ i tried to explain the Google's own TTS Engine.Since Silverlight/WPF on Desktop/Web and Silverlight in Windows Phone are different versions,im quite sure a very sandboxed lighweight platform like WP7 cannot have a speech api built-in except for the "Microsoft TellMe".But then again you cant access "TellMe" using code either.Only Lync and Kinect support for Developers.This article targets both Windows Phone 7 and 8 developers :)
Mahesh ChandPosted Dec 8, 2012, 10:11 PM
OK, here is an article http://www.adambenoit.com/applications/text-speech-windows-phone-8/ Looks like it is using same class we have in WPF.
Mahesh ChandPosted Dec 8, 2012, 10:06 PM
OK that sounds like a trick. But doesn't Windows Phone (XAML) has TTS and SR API? I know WPF and XAML has speech API.
Ibrahim ErsoyPosted Dec 8, 2012, 3:58 PM
Your welcome :)
YadPosted Dec 8, 2012, 3:25 PM
This is so cool Thanks!