下沉 tts 功能,分别实现"小智语音"和"小迪语音"

This commit is contained in:
wangcongtao
2020-10-12 20:21:15 +08:00
parent f628198de9
commit 0b7468a8a8
42 changed files with 1363 additions and 572 deletions

View File

@@ -1,57 +0,0 @@
package com.mogo.module.tanlu.voice
import com.zhidao.auto.platform.voice.VoiceClient
/**
* @description 声音控制类
*
* @author lixiaopeng
* @since 2019-11-01
*/
object VoiceController {
private lateinit var voiceClient: VoiceClient
// fun initVoice() {
// voiceClient = VoiceClient.getInstance(BaseApplication.getAppContext())
// }
/**
* 设置语音命令回调接口
* @param callBack
*/
fun setCallBack(callBack: VoiceClient.VoiceCmdCallBack) {
voiceClient.setCallBack(callBack)
}
/**
* @param speakText 语音播报内容
*/
fun speakVoice(speakText: String) {
voiceClient.speakDefault(speakText)
}
/**
* 注册免唤醒命令
* @param customType 命令
* @param customWakeupCmd 命令对应的唤醒词集合
*/
fun registerCustomWakeupCmd(customType: String, customWakeupCmd: Array<String>) {
voiceClient.registerCustomWakeupCmd(customType, customWakeupCmd)
}
/**
* 取消免唤醒命令
* @param customType 命令
*/
fun unRegisterCustomWakeupCmd(customType: String) {
voiceClient.unRegisterCustomWakeupCmd(customType)
}
/**
* 释放资源(界面销毁的时候调用)
*/
fun release() {
voiceClient.release()
}
}