2013-10-26 69 views
0

我初学者在机器人 声音的再认识我跟随这tutorial创建一个语音输入IME如何从语音输入IME获取/编辑文本输出

我花了一整天找方法来访问并修改来自IME语音识别的文本输出。 我尝试编辑任何属性可能会返回文本从类认可:
- ActivityHelper
- ImeTrigger
- IntentApiTrigger
- ServiceBridge
- ServiceHelper
- 触发
- VoiceRecognitionTrigger

但不起作用:( 任何人有一个建议吗?非常感谢:)

回答

0

本教程提供了一个jar文件,您可以将其导入到您的代码中,或者您可以单独导入这些类。 They are available here

看着类IntentApiTrigger它似乎有许多引用将填充EditText字段的文本。

private void postResult(String recognitionResult) { 
    mLastRecognitionResult = recognitionResult; 

    // Request the system to display the IME. 
    getInputMethodManager().showSoftInputFromInputMethod(mToken, 
      InputMethodManager.SHOW_IMPLICIT); 
} 

里有方法的其他引用:

private void commitResult() { 

而且

private String format(ExtractedText et, String result) { 

您应该能够从那里操纵它们。

希望有所帮助。