ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## 翻译 在 **SpeechRecognizer** 中指定对应的参数后,可以使用翻译功能,即传入当前语种音频,返回识别并翻译后的目标语种文本结果。 主要涉及以下参数 * SpeechConstant.ASR_SCH 启用翻译 * SpeechConstant.ADD_CAP 翻译通道 * SpeechConstant.ORI_LANG 原始语种 * SpeechConstant.TRANS_LANG 目标语种 * SpeechConstant.TRS_SRC 结果格式 ~~~ mAsr.setParameter( SpeechConstant.ASR_SCH, "1" ); mAsr.setParameter( SpeechConstant.ADD_CAP, "translate" ); mAsr.setParameter( SpeechConstant.TRS_SRC, "its" ); mAsr.setParameter( SpeechConstant.ORI_LANG, "cn" ); mAsr.setParameter( SpeechConstant.TRANS_LANG, "en" ); mAsr.startListening( mRecognizerListener ); ~~~ 翻译结果格式,参考附录。