Home > Mobile >  Xunfei dictation streaming version can't get dictation results
Xunfei dictation streaming version can't get dictation results

Time:02-20

Don't know if anyone encountered the same problem with me, such as title, use the hkust xunfei dictation in the process of the interface, I can't put in the following code to obtain the value back to the outer function, and the result is an input box Mainactivity, only value test result update to the input box, now I put what the values to the function of external what should I do?
I tried the other assignment for string, list, don't have a way to pass the value to the queue, solving,
Public void btnvoice (Context application, final EditText result) {

Dialog. SetListener (new RecognizerDialogListener () {
@ Override
Public void onResult (RecognizerResult RecognizerResult, Boolean b) {
String sentence=parseIatResult (recognizerResult getResultString ());
Text=sentence;//1
Result. Append (sentence);//2
}
@ Override
Public void one rror (SpeechError SpeechError) {

}
});
Dialog. The show ();
Toast. MakeText (application, "please began to speak," Toast. LENGTH_SHORT), show ();
Result. Append (text);
}

CodePudding user response:

Message may not be able to reply in time, can add my QQ: 2691049696

CodePudding user response:

You can take a look at this https://blog.csdn.net/qq_38436214/article/details/106900471

CodePudding user response:

Use interface + listener callback wow

CodePudding user response:

refer to the second floor beginners - Study reply:
can you take a look at this https://blog.csdn.net/qq_38436214/article/details/106900471
thanks for bosses
  • Related