Meaningless Drivel is fun!*
The moose likes Android and the fly likes java code for speech to text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "java code for speech to text" Watch "java code for speech to text" New topic
Author

java code for speech to text

Glen Hynes
Greenhorn

Joined: Jan 05, 2013
Posts: 2
hello all. the code below is used to convert speech to text on an android app. This code works when the speech button is pressed and whatever you say is transferred into text.
When the speech function closes, the the text is showing.
If you hit the speech button again, the previous text is cleared and the new text shows on the page.
Can anyone help me edit the code so that the previous texts remain on the page?


Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3947
    
  17

The general strategy would be to get the previous text, append the new String to the old text, then add the text back to the TextView. It may be a little more complicated because you probably want to add a line break, and maybe other conditions (like a fixed number of lines to display, scrolling, or something.

An alternative to the TextView which may better match your goals might be to use a ListView. The ListView can be bound to an ArrayAdapter. Whenever you get a String you would add it to the ArrayAdapter, which would cause the ListView to expand to accommodate the new text. It makes it easier to control the values which get displayed (the number of lines, formatting, etc...)


Steve
Glen Hynes
Greenhorn

Joined: Jan 05, 2013
Posts: 2

Thanks. this sounds like exactly what i need. now to go and try write this into the code! i am a beginner with java so any help appreciated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java code for speech to text
 
Similar Threads
Is there a way to add Text-to-speech to a call?
how to send multiple images to server
how to create sdcard and mount on the emulator
Fetching contacts from phone book
Problem with creating a simple Menu in Browser view.