From c2a862a17b7835075a89fab2d44095f2fc568801 Mon Sep 17 00:00:00 2001 From: Valentin Kravtsov Date: Mon, 1 Feb 2010 16:51:47 +0000 Subject: [PATCH] Adding VoiceIME support for the modified RecognitionManager Now there is a delay each time the voice recognition screen is opened, however, this is the correct behavior as microphone setup takes about 600ms. The previous implementation, although being fast, was not actually recording the first 1/2 second of user's speech. Change-Id: I8b8373a59658502f7451150ff4a4ffd1c8e83205 --- AndroidManifest.xml | 1 + .../android/inputmethod/voice/VoiceInput.java | 83 ++++++++----------- 2 files changed, 36 insertions(+), 48 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7b2e9b6c9..2d152ad10 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -5,6 +5,7 @@ + results = resultsBundle - .getStringArrayList(RecognitionManager.RECOGNITION_RESULTS_STRING_ARRAY); + .getStringArrayList(RecognitionManager.RESULTS_RECOGNITION); mState = DEFAULT; final Map> alternatives = @@ -499,15 +489,12 @@ public class VoiceInput implements OnClickListener { mRecognitionView.finish(); } - public void onInit() { - mIsRecognitionInitialized = true; - if (mState == LISTENING) { - startListeningAfterInitialization(mStartListeningContext); - } + public void onPartialResults(final Bundle partialResults) { + // currently - do nothing } - public void onPartialResults(final Bundle partialResults) { - // TODO To add partial results as user speaks + public void onEvent(int eventType, Bundle params) { + // do nothing - reserved for events that might be added in the future } } }