btnMicrofone.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
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,"Hola tudo bom");
try{
startActivityForResult(intent,REQ_CODE_SPEECH_INPUT);
}catch(Exception e){Toast.makeText(getApplicationContext(), "Não há suporte", Toast.LENGTH_SHORT).show();}
}
});
@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data){
super.onActivityResult(requestCode,resultCode,data);
switch(requestCode){
case REQ_CODE_SPEECH_INPUT:{
if(resultCode==RESULT_OK && null != data){
result=data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
etChat.setText(result.get(0).toString());
}
break;
}
}
}
Eu quero passar sinais de audio de 16bits pro google Reconhecer a minha voz
e me passar o texto da fala…
Eu já consegui gravar audio em short[] mas preciso passalo para o reconhecimento
de voz do google do codigo acima…
alguem sabe alguma coisa sobre como eu fasso isso…
qualquer informação é bem vinda pra ajudar…
existe algum metodo pra passar o sinal de audio bruto pro reconhecimento de
voz do google e retornar texto da fala?