Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
- intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
- RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
- intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
- "com.domain.app");
- intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
- Intent.putExtra(/*Add more stuff that I want*/);
- RecognitionListener listener = new RecognitionListener() {
- @Override
- public void onPartialResults(Bundle results) {
- //What am I supposed to get when I do get PartialResults????
- }
- @Override
- public void onResults(Bundle results) {
- }
- @Override
- public void onReadyForSpeech(Bundle params) {
- }
- @Override
- public void onError(int error) {
- }
- @Override
- public void onBeginningOfSpeech() {
- }
- };
- SpeechRecognizer recognizer = SpeechRecognizer
- .createSpeechRecognizer(this.getApplicationContext());
- recognizer.setRecognitionListener(listener);
- recognizer.startListening(intent);
Add Comment
Please, Sign In to add comment