Android :: String Input For Speech Engine
Jan 7, 2010
It seems to me that the method "speak" of class TextToSpeech only works in method onInit or on Utterance Completed. However, onInit and onUtteranceCompleted don't have any parameter for passing strings. In the following code, I tried to define a global string arraylist outside the methods and used the arraylist for string input.For some reason , it didn't work out.But the engine did speak "did you sleep well". public class TTS extends Activity implements OnInitListener,OnUtteranceCompletedListener,Runnable ArrayList<String> content=new ArrayList<String>();
int MY_DATA_CHECK_CODE=50;
private TextToSpeech mTts;
public void onCreate(Bundle savedInstanceState) {
content.add("test");
content.add("another test");
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
mTts = new TextToSpeech(this,this);
} else { // missing data, install it
Intent installIntent = new Intent();
installIntent.setAction(
TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
} public void onInit(int status){
if(status==TextToSpeech.SUCCESS){
mTts.setLanguage(Locale.US);
mTts.setOnUtteranceCompletedListener(this);
String myText1 = "Did you sleep well?";
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);
for(int i=0;i<content.size();i++){
mTts.speak(co
View 1 Replies
Jun 23, 2010
I have a service from where i am trying to start a TextToSpeech engine ,but it seems that it's not working , so is it possible to start tts from a service? code...
View 1 Replies
View Related
Jan 3, 2013
Whenever I try to access my text-to-speech settings, I always get the error: "The application Settings (process com.android.settings) has stopped unexpectedly. Please try again." Not sure how to fix this. I've been trying to use utter! and Assistant, but neither give me voice feedback, and utter! tells me that the text-to-speech engine initialization failed. how to fix and/or rebuild the tts engine? I don't really want to do a factory reset or reinstall my ROM. Also, please note that the ROM is not the problem, I've already researched this. Also note that I have Google Voice and Voice Search both installed, and both work just fine. I can input commands vocally, but the text-to-speech issue does not funcion.
View 1 Replies
View Related
Nov 29, 2010
I would like to set up custom notification sounds for the various apps (email, message, FB, etc.). I would prefer that instead of using the various cute sound effects that come with the phone, I want to have a voice that says, "new email" or "new message" instead of the various beeps and chimes. Ideally, I would like to use the text to speech engine that comes with the phone to do this like what the Navigation app. How can I set up the notifications to activate the text to speech engine to say a certain phrase? If that is not possible, how can I activate the text to speech engine to say a phrase and then save the output to a sound file which I can then select as the notification for those various apps?
View 2 Replies
View Related
Nov 13, 2009
Is there a way to use an audio file as input to speech recognition? If not, is this feature expected in the foreseeable future?
A separate question (and this is going to sound ridiculous, but it might actually be okay for a joke app I'm thinking about): Would it be possible to play audio out of an Android handset, while at the same time having a recognizer listen to it via the microphone? (Guess I could just try it.)
View 3 Replies
View Related
Nov 1, 2009
I want to use the SR api to handle commands in my application. I know at any given point in my application what the valid commands would be at that point so would like to limit the results that the SR is matched against. For example, if the only valid commands were "Yes" or "No" I would like to be able to restrict the SR to only try and match against those two words. Otherwise on full vocabulary I get "Snow" and other false words. Limiting the vocabulary should make matching 90%+ accurate on limited words. Is this possible? Also, can I limit the SR to only match numeric for number input only? The internal dialer seems to be able to do this sort of this, so can I?
View 7 Replies
View Related
Feb 17, 2010
I want to pass a String like the input of a new activity, to let this one use the String some operations. The code I try is this..
And in the activity I try to recover it:
String textout = savedInstanceState.getString("contactcode");
In the onCreate part. I have seen that uris are normally used, but I don't know how to pass that String by using a URI.
View 3 Replies
View Related
Jul 23, 2009
I'm downloading text data from a web server, and getting an Input Stream. The data will be relatively large and delimited. I want to split this data by the deliminator and store each piece in the DB. Is it faster to read the Input Stream byte by byte to split the data and store each piece in the DB, or would it be faster to convert the Input Stream to a String and use an existing function such as Split?
View 2 Replies
View Related
Sep 30, 2009
I have a problem with my DDMS in eclipse. In the logcat view appears only this failure: Logcat View fails with "Could not create the view: For input string: "our" "
I uninstalled and reinstalled the adt and ddms already without any change. I can use the logcat in the command line (tools- adt logcat) but this is not as comfortable as using the logcat in eclipse.
More details of this failure message are:
CODE:...............
View 2 Replies
View Related
Aug 2, 2009
How to I properly parameterize the speech recognizer so that it can more easily recognize the words that the user will probably say?
As far as I can tell there is no way.
I believe this site is wrong: http://www.4feets.com/2009/04/speech-recognition-in-android-sdk-15/
CODE:............
Will give a hint to the recognizer that you might say those words. However, it appears to do absolutely nothing. It also conflicts with the google documentation which says:
"An ArrayList of the potential results when performing ACTION_RECOGNIZE_SPEECH. Only present when RESULT_OK is returned." This hints that the array is a return value NOT an input.
To test this out try adding: ArrayList< String > potentialResults = new ArrayList< String >(); potentialResults.add("cumin"); and try to get the speech recognizer to recognize it. You will find it very difficult.
How to properly control the speech recognizer?
View 3 Replies
View Related
Apr 4, 2012
I am developing an app that uses the speech recognizer but I only want the speech recognizer to listen for speech for x number of seconds regardless of when the last speech input was or was not recognized. I looked through the speech recognizer documentation and I didn't see parameter to set the exact time the speech recognizer runs for. How I could accomplish this?
View 2 Replies
View Related
Jul 24, 2010
I just found this new Speech-to-Speech program for Android called Edwin. It's pretty awesome!! You simply say or ask it a question and it will reply to you with the proper response.
Here's the link to more info and a video demo:Android Zoom - Edwin, Speech-to-Speech
View 18 Replies
View Related
Jul 25, 2010
I just found a very cool app called Edwin, Speech-to-Speech in appbrain installed and must say its makes you feel like you have truly a SMART phone. asked it weather, time, open app, spell a word, definition of word etc etc and it spoke it everytime, tried to stump it with weather in hong kong and it told me! anyway it takes voice command to a very big next level.
View 49 Replies
View Related
Jun 29, 2010
I have the localized strings file that is used in the Iphone app that I work on to port to Android. Are there any tools that go through the file taken from the xcode project and build the xml needed to use the strings in android? This tool should be easy to build but I appreciate any pointers to already working tools.
View 4 Replies
View Related
Oct 1, 2010
In Android, capturing date from datepicker and storing as string in sqlite. Sorting by date doesn't work because they're strings (unless I'm doing it wrong.I've googled this issue for ~5 days, and it looks like there should be a way to capture the date from the date picker, convert it to a Long, store it in sqlite as a Long, select and sort on the Long date value, then convert the Long back to a "mm/dd/yyyy" string for display. I've tried various combinations of parse statements, Date, FormatDate, etc. with no luck at all.On activity start, get today's date and display it in button which calls the datepicker.Capture new date from datepicker (if one is entered), save it as a long to sqlite.On opening an activity showing a listview of records, select from sqlite with orderby on date (Long), convert Long to "mm/dd/yyyy" string for display in ListView.
View 3 Replies
View Related
May 5, 2009
If there's anyway way I to access the String values of String resources statically? e.g. a static equivalent of Context.getString(...)?
View 5 Replies
View Related
Nov 12, 2010
I have preferences where you can enable/disable what items will show up on the menu. There are 17 items. I made a string array in values/arrays.xml with titles for each of these 17 items.
I have preferences.xml which has the layout for my preferences file, and I would like to reference a single item from the string array to use as the title.
In the Android developer reference, I see how I can reference a single string with XML, but now how I can reference a string from an array resource in XML.
View 3 Replies
View Related
Aug 4, 2010
Can anybody give me some clue that how to convert binary string into a string(english). I have tried and googled so much but couldn't find an answer.
View 1 Replies
View Related
Jul 27, 2010
I have a class that creates a view to gather data via a function getView() that provides a view with an EditText.This class has also has variable answer.When the user chances the EditText I want to store the content of the EditText in answer.If I would use an onKeyListener I fear that the answer will probably get stored before the last letter is entered.Is there a good way to handle this in the getView() function via some other listener?
View 1 Replies
View Related
Jan 6, 2010
I would like to show a custom input field (specifically, one containing only 9-0 and two extra buttons containing decimal separator (, or .) and a delete button). I could create a custom IME, but (as far as I know) that would have to be set by the user as the system-wide input method. Is there a way to implement an input method and bind it to a specific input field?
View 1 Replies
View Related
Nov 11, 2010
I have made a service which extends Service in android, and running in the background of my android app. What I want from this background service is to get the euro to dollar exchange rate from a finance website, I have my service ready, it can periodically run a function, I am now need to implement the function to get the euro-dollar rate from a website, there are many this kind of website, my question is, how can I get the currency rate as a string from the website, and pass the string to my service?
View 2 Replies
View Related
Aug 26, 2010
I have an Android app where I want to check to see if an app name that is installed matches a string passed to the function containing this code.Assuming you called checkInstalledApp('SetCPU'); and the app name on the phone is called the same thing it should return true. However, it never does. I logged the results and it should match up but it does not. Can anyone please enlighten me as to why this doesn't work?
View 3 Replies
View Related
Nov 16, 2010
Does anyone have any idea how to find the n-th field (string) in a delimited string where the delimiters (separator) could be either a single char or several chars.and the syntax for user-defined function is FindNthField(string,separator,position)so position 3 would return three,The separator in use would actually be Chr(13).This has to run on Android and so should be efficient.
View 3 Replies
View Related
Oct 28, 2009
I want to get an array of strings reading from arrays.xml file we add in android values/ folder. Could any one kindly give a solution for this. Otherwise I will have to input each these entries in strings.xml and take them to java code using getResources()getString()
View 2 Replies
View Related
Sep 7, 2010
Is it possible to have a string value in string.xml of the sort " some string PLACEHOLDER1 some more string" so that the place holders can be assigned the value at run time.
View 1 Replies
View Related
Nov 17, 2009
I would like to be able to say an email or text message to myself or my wife sometimes. When I hold down the input field I get an input choice menu but the only option there is the Android Keyboard.Am I doing it wrong?What am I missing? I would also like to have it read emails to me, and word docs (or just .txt).I have a Kindle but my phone is a little more convenient for something I would rather read in bits and pieces while walking to and fro the car or whatever.
View 8 Replies
View Related
Oct 18, 2010
I'm interested in developing an android application that will display a globe of some sort like Google Earth. I've never used opengl or have any experience with graphic programming so I'm here to learn some basics. Now, I know there are things like the Unity or Ogre that help facilitate graphics but what exactly do I gain from using these engines as opposed to just using opengl api to render graphics? Why do you use engines like Ogre as opposed to straight up opengl?
View 2 Replies
View Related
Aug 19, 2010
I have installed Power Strip, and the very first time I was asked to use my preferred home screen, I selected the existing one (using a GS).
What I want to do is to have Power String dock displayed if I do a double click on the home key. I played with the settings but it seems that it doesn't work. Any hint?
View 13 Replies
View Related
Dec 26, 2009
I've been working for the past couple of days to allow users to login to an android app with their gmail account and pass the authentication token to my app hosted on app engine - so i can download xml from my web services hosted on app engine as if the user logged into the app directly. There is a lot of info on ways to get the google auth code and the auth cookie and then pass the cookie in the header of an http request - but no info out there on doing all of this from android and going as far as to add the cookie to the remaining http requests. So, now that's it's working, i thought i'd compile it all together and post the solution here in my blog - enjoy.
View 3 Replies
View Related
Aug 16, 2010
I'm just starting into Android game development, and I'm looking into using an open-source game engine as the foundation of some of my ideas. Does anyone have any favorites? So far, AndEngine looks the most promising...I've also looked at Rokon. Any other notable engines I should be looking at.
View 2 Replies
View Related