android - 在 Oppo 中将语音转换为文本时出现录音和客户端错误
问题描述
如何在将语音转换为文本时修复 语音识别ERROR_AUDIO = 3(Audio recording error)
器ERROR_CLIENT = 5(Client side error)
(使用带有计时器的自定义对话框进行录音)
speechRecognizer = SpeechRecognizer.createSpeechRecognizer(context!!)
speechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
speechRecognizerIntent?.putExtra(
RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
)
speechRecognizerIntent?.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault())
speechRecognizerIntent?.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3)
speechRecognizer?.setRecognitionListener(this)
解决方案
推荐阅读
- javascript - 滚动时图像背景更改
- angular - 在 Angular 10 中制作单选按钮
- android - ReferenceError:使用 Android Firefox 时未定义 SharedArrayBuffer
- elasticsearch - 弹性搜索聚合不适用于子字段关键字
- javascript - 使用 Google 登录 - 自定义按钮外观
- dependency-injection - WELD-001562:具有通用签名的生产者方法
- javascript - 从 Mongo DB 文档的数组中的对象数组中删除一个值
- mysql - 停止自动创建 MySQL 索引以避免列的重复条目
- html - 按钮的标签重定向到仅用于按钮的链接
- python - 使用 Python 将转换为 CSV 的 PDF 与另一个 CSV 进行比较