0

im now writing STT in android studio and i have a question for some code lines.

intent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,getPackageName());
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,"en-US");

The first line is set intent fot getting input of user's speech and the last one is for setting language that we going to use. but what about a second line?

Even though i read public documentation, cannot understand.

'The extra key used in an intent to the speech recognizer for voice search'

i understand that like this: after getting input of speech from the first line, use the input in the intent - and what kind of intent? - to the speech recognizer for voice search.

but still not sure..

can you give me an explanation?4

Thank you in advance

1 Answers1

0

it's a flag that is used by voice search API to identify the called to this API (your application) so the voice search implements the callbacks and ... based on your package name...