【问题标题】:How to get/edit text output from Voice Typing IME如何从语音输入 IME 获取/编辑文本输出
【发布时间】:2013-10-26 16:03:10
【问题描述】:

我是 android 语音识别的初学者 我正在关注这个tutorial 来创建语音输入 IME

我花了一整天的时间寻找从 IME 识别的语音中访问和修改文本输出的方法。 我试图编辑任何可能返回从类中识别的文本的属性:
- 活动助手
- ImeTrigger
- IntentApiTrigger
- 服务桥
- 服务助手
- 触发器
- 语音识别触发器

但它不起作用:( 有人有建议吗?非常感谢:)

【问题讨论】:

    标签: android voice-recognition voice ime


    【解决方案1】:

    本教程有一个 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) {
    

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

    希望对您有所帮助。

    【讨论】:

    • 很好奇为什么这个voiceimeutils.jar,VoiceRecognitionTrigger的超时时间很长?
    猜你喜欢
    • 1970-01-01
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-22
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    相关资源
    最近更新 更多