小编Vis*_*hal的帖子

Android 语音识别自定义音频源

Android RecognizerIntent 文档指出

public static final String EXTRA_AUDIO_INJECT_SOURCE

Intent 中使用的额外关键是提供一个已打开的音频源供 RecognitionService 使用。数据应该是音频资源的 URI。

https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_AUDIO_INJECT_SOURCE

但没有关于此密钥的其他参考资料或用户文档。因此,尚不清楚此功能如何工作以及使用此密钥作为数据传递什么。

我尝试为 中的音频录制文件传递 Uri res/raw,但 Android 12 模拟器中的 SpeechRecognizer 忽略了该文件。

有人可以指出我如何在 SpeechRecognizer 中正确注入音频资源/源的正确方向吗?

android uri speech-to-text android-intent

6
推荐指数
0
解决办法
736
查看次数

标签 统计

android ×1

android-intent ×1

speech-to-text ×1

uri ×1