I worked on the web on text to speech and there I can add an extra answer string to force API yo match my converted text to answer text and then I can the result more accurately. How I can implement the same in Android.
{ "config": { "encoding": "LINEAR16", "sampleRateHertz": 16000, "languageCode": "en-US" "speechContext": "This is my answer" }, "audio": { "uri": "http://gsYOUR_BUCKET_NAME/YOUR_FILE_NAME" } }
I know how to implement Speech to text in android but how to add a matching string with that to obtain batter matching result than simple speech to text and then match.
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
getString(R.string.speech_prompt));
Aucun commentaire:
Enregistrer un commentaire