Привет, как получить записанный аудиофайл в speecRecognizer методами RecognitionListener. Я использую намерение распознавателя, но не эту опцию.
speechRecognizer = SpeechRecognizer.createSpeechRecognizer (this);
speechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
speechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
Log.e("vbvb", "Locale: "+Locale.getDefault().getLanguage());
speechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "az-AZ");
//speechRecognizerIntent.putExtra("android.speech.extra.GET_AUDIO_FORMAT", "audio/AMR");
//speechRecognizerIntent.putExtra("android.speech.extra.GET_AUDIO", true);
@Override
public void onResults(Bundle results) {
ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if(matches != null) {
String result = matches.get(0);
Toast.makeText(MainActivity.this, result, Toast.LENGTH_LONG).show();
//Uri audioUri = speechRecognizerIntent.getData();
sendApiRequest(result);
}
}