Hi i am making an app like google assistant i want the assistant to read the search result after a google search similar to what a google assistant does how can i do that please help
Yeah similar to the block you shown
How to put the searched result into text to speech so that it can read the result after search
How you can use the searched result using the TTS blocks to"read the result after search" depends on your existing code and how you captured the searched result (which you have not shared).
If the ‘search result’ is in the form of text, you probably can do it with the Block posted in post #4.
Since you have the code to do the search; capture the search results and place the results of the search in the box that currently indicates “the searched Text” if the search result is in text format. If the search result is not in text form, write code to put it into that format. You can probably use the Block in a Button event handler to read back the result.
"capture the search results and place the results of the search in the box that currently indicates “the searched Text” if the search result is in text format"
This is the part i dont know to do
The Web component is better than the WebView for capturing text from the Web.
It has an Event block When Web1.GotText that will receive the answer, and can supply the incoming text to feed to TextToSpeech.
But beware, Google can be a blabbermouth.
When you perform this search, the WebViewer displays a Web page. It does not display text. To use the TTS.Speak to read back the contents of the Web page, the information you want to 'speak' needs to be 'converted' to text. Follow ABG's advice or 'scrape' the Web page. This is not trivial.
What are you searching for and what do you expect the TTS to say? Please provide an example
Here is what you can do:
The green blocks Search for Homer.jpg and display a Web page using a WebViewer.
The red blocks use the Web control to extract the text of that Web page.
Once you extract the text (there is certainly a lot, isn't there?), you have to the parts you want the TTS to enunciate. The problem is the Web search generates a lot of text; you need to isolate what you need. That might be very difficult.
Thank you for the help