public class Agent extends BaseNode
Modifier and Type | Class and Description |
---|---|
static class |
Agent.DuplexMode |
static class |
Agent.RecorderMode |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
bc, DEFAULT_BUS_SERVER
Constructor and Description |
---|
Agent(android.content.Context context)
构造方法,开发者可以不关注该构造方法,
而是可以通过
DDS.getAgent() 获取Agent实例 |
Modifier and Type | Method and Description |
---|---|
void |
avatarClick()
点击唤醒/停止识别/打断播报 操作接口
|
void |
avatarClick(java.lang.String greeting)
点击唤醒/停止识别/打断播报 操作接口
|
void |
avatarPress()
按下按键接口
|
void |
avatarRelease()
释放按键接口
|
void |
clearAuthCode()
清除 authcode, 该方法需要在SDK初始化后使用;
与之对应的方法是
setAuthCode(AuthInfo, TokenListener) |
void |
clearCommandWakeupWord()
Deprecated.
|
java.lang.String |
clearDeviceInfo(java.lang.String key)
清空客户端上传的设备信息
|
void |
clearShortCutWakeupWord()
Deprecated.
|
void |
closeTip()
关闭tip提示音
|
void |
disableWakeup()
Deprecated.
|
void |
enableWakeup()
Deprecated.
|
java.lang.String |
endSkillInDialog()
Deprecated.
Replaced by
updateDispatchEvent(JSONObject) } |
void |
feedbackNativeApiResult(java.lang.String nativeApi,
DuiWidget duiWidget)
反馈native api的执行结果
|
void |
feedOpus(byte[] opus)
外部录音机拾音接口
|
void |
feedPcm(byte[] pcm)
外部录音机拾音接口
|
void |
feedSbc(byte[] sbc)
外部录音机拾音接口
|
java.lang.String |
getAddress() |
ASREngine |
getASREngine()
获取ASR引擎
|
java.lang.String |
getDeviceInfo()
获取客户端保存的设备信息
|
Agent.DuplexMode |
getDuplexMode()
获取当前的运行模式
|
java.lang.String |
getMinorWakeupWord()
Deprecated.
|
java.lang.String |
getName() |
java.lang.Object |
getProductContext(java.lang.String inputKey)
获取产品的配置信息
|
java.lang.String |
getResourceVersion()
获取当前的产品资源版本号
|
java.lang.Object |
getSkillContext(java.lang.String skillId,
java.lang.String inputKey)
获取技能的配置信息
|
java.util.List<SkillConfig> |
getSkillList() |
java.util.Set<java.lang.String> |
getSubscribedTopics() |
TTSEngine |
getTTSEngine()
获取TTS引擎
|
int |
getUiagentProt() |
long |
getVadPauseTime()
Deprecated.
|
java.lang.String |
getValidH5Path()
获取资源包中H5资源的路径
|
VprintEngine |
getVprintEngine()
获取Vprint引擎
|
WakeupEngine |
getWakeupEngine()
获取Wakeup引擎
|
java.lang.String[] |
getWakeupWords()
Deprecated.
|
void |
notifyTTSEnd()
外部TTS播报结束通知接口
|
BusClient.RPCResult |
onCall(java.lang.String url,
byte[]... args) |
void |
onCreate()
invoked when this node is created
|
void |
onDestroy()
invoked when this node is being destroyed
|
void |
onExit()
invoked when this node exit from bus
|
void |
onFirstObserverAttached(java.lang.String topic) |
void |
onJoin()
invoked when this node join bus
|
void |
onMessage(java.lang.String topic,
byte[]... parts)
invoked when topic received.
|
void |
onNoObserverAttached(java.lang.String topic) |
void |
openTip()
打开tip提示音
|
void |
pauseDialog()
暂停当前对话
|
void |
resumeDialog()
恢复当前对话
|
void |
sendText(java.lang.String text)
输入文本的接口
|
void |
setAuthCode(AuthInfo authInfo,
TokenListener tokenListener)
dca授权登录, 该方法需要在SDK初始化后使用;
此方法应该在 OathSDK 登录获取 authCode 后使用
与之对应的方法是
clearAuthCode() |
void |
setCustomTips(org.json.JSONObject obj)
此接口支持动态修改 custom tips
|
void |
setDDSMode(int mode)
设置场景模式
|
void |
setDMCallback(DMCallback callback)
Deprecated.
该接口极端情况会导致rpc死锁问题,已舍弃。建议使用支持
topic 的{setDMTaskCallback(DMTaskCallback) }接口 |
void |
setDMTaskCallback(DMTaskCallback dmTaskCallback)
此接口支持修改对话中的语音播报,修改文本展示等功能
|
void |
setDuplexMode(Agent.DuplexMode duplexMode)
设置dds策略
|
void |
setEnableVoip(boolean enableVoip)
设置是否使用voip功能
|
void |
setRecorderMode(Agent.RecorderMode recorderMode)
设置外部录音机拾音模式
|
void |
setTTSRequestListener(TTSRequestListener listener)
外部TTS引擎注册接口
|
boolean |
setVadPauseTime(long millis)
Deprecated.
|
void |
shutup(java.lang.String ttsId)
Deprecated.
|
void |
speak(java.lang.String text,
int priority)
Deprecated.
|
void |
speak(java.lang.String text,
int priority,
java.lang.String ttsId,
int audioFocus)
Deprecated.
|
void |
startDialog()
开启新对话
|
void |
startDialog(org.json.JSONObject jsonObject)
开启新对话
|
void |
stopDialog()
停止当前对话,包括停止合成,取消识别等
|
void |
stopDialog(org.json.JSONObject jsonObject)
停止当前对话,包括停止合成,取消识别等
|
void |
subscribe(java.lang.String[] commands,
CommandObserver commandObserver)
订阅command
|
void |
subscribe(java.lang.String[] messages,
MessageObserver messageObserver)
订阅messages
|
void |
subscribe(java.lang.String[] nativeApis,
NativeApiObserver nativeApiObserver)
订阅nativeApi
|
void |
subscribe(java.lang.String command,
CommandObserver commandObserver)
订阅command
|
void |
subscribe(java.lang.String message,
MessageObserver messageObserver)
订阅message
|
void |
subscribe(java.lang.String nativeApi,
NativeApiObserver nativeApiObserver)
订阅nativeApi
|
void |
subscribeSync(java.lang.String[] commands,
CommandObserver commandObserver)
订阅command
|
void |
subscribeSync(java.lang.String[] messages,
MessageObserver messageObserver)
订阅messages
|
void |
subscribeSync(java.lang.String[] nativeApis,
NativeApiObserver nativeApiObserver)
订阅nativeApi
|
void |
triggerIntent(SkillIntent skillIntent)
主动触发意图的接口
|
void |
triggerIntent(java.lang.String skill,
java.lang.String task,
java.lang.String intent,
java.lang.String slots)
Deprecated.
主动触发意图的接口
跳过识别和语义,直接进入指定的意图对话 |
void |
unSubscribe(CommandObserver observer)
注销CommandObserver.
|
void |
unSubscribe(MessageObserver observer)
注销MessageObserver.
|
void |
unSubscribe(NativeApiObserver observer)
注销NativeApiObserver.
|
void |
unSubscribeSync(CommandObserver observer)
注销CommandObserver.
|
void |
unSubscribeSync(MessageObserver observer)
注销MessageObserver.
|
void |
unSubscribeSync(NativeApiObserver observer)
注销NativeApiObserver.
|
void |
updateCommandWakeupWord(java.lang.String[] actions,
java.lang.String[] words,
java.lang.String[] pinyin,
java.lang.String[] threshold,
java.lang.String[][] greetings)
Deprecated.
|
java.lang.String |
updateDeviceInfo(java.lang.String deviceJson)
Deprecated.
|
java.lang.String |
updateDispatchEvent(org.json.JSONObject obj)
多模态事件同步,该接口用于客户端给对话中控发送一个事件
|
void |
updateMinorWakeupWord(java.lang.String word,
java.lang.String pinyin,
java.lang.String threshold,
java.lang.String[] greetings)
Deprecated.
|
void |
updatePermanentSkill(org.json.JSONArray jsonArray)
新增技能锁定接口,让用户说的话只落在锁定的技能里
|
void |
updatePhraseHints(PhraseHintsIntent... phraseHints)
更新热词识别接口(请求级别)
|
java.lang.String |
updateProductContext(ContextIntent intent)
更新设备状态,产品级的配置。比如:定位信息,设备硬件状态等
更新结果可以通过sys.upload.result消息来获取
|
void |
updateShortcutWakeupWord(java.lang.String[] words,
java.lang.String[] pinyin,
java.lang.String[] threshold)
Deprecated.
|
java.lang.String |
updateSkillContext(ContextIntent intent)
更新技能配置,需要调用ContextIntent.setSkillId设置技能ID
更新结果可以通过sys.upload.result消息来获取
|
java.lang.String |
updateVocab(java.lang.String vocabName,
java.lang.String[] contents,
boolean addOrDelete)
Deprecated.
Replaced by
updateVocabs(VocabIntent...) |
java.lang.String |
updateVocabs(VocabIntent... vocabs)
更新词库接口
|
dump, dump, getBufferSize, getBusClient, isRunning, onRetry, publishSticky, removeSticky, run, start, stop
public static final java.lang.String TAG
public Agent(android.content.Context context)
DDS.getAgent()
获取Agent实例context
- contextpublic void onCreate()
BaseNode
public void onJoin()
BaseNode
public void onExit()
BaseNode
public void onDestroy()
BaseNode
public java.lang.String getAddress()
getAddress
in class BaseNode
public BusClient.RPCResult onCall(java.lang.String url, byte[]... args) throws java.lang.Exception
java.lang.Exception
public void onMessage(java.lang.String topic, byte[]... parts) throws java.lang.Exception
BaseNode
only handle bus.event in BaseNode
onMessage
in interface BusClient.Handler
onMessage
in class BaseNode
java.lang.Exception
public void subscribe(java.lang.String[] commands, CommandObserver commandObserver)
commands
- commands数组commandObserver
- 当订阅的command被触发了,会通知到commandObserverpublic void subscribeSync(java.lang.String[] commands, CommandObserver commandObserver)
commands
- commands数组commandObserver
- 当订阅的command被触发了,会通知到commandObserverpublic void subscribe(java.lang.String command, CommandObserver commandObserver)
command
- 单个commadcommandObserver
- 当订阅的command被触发了,会通知到commandObserverpublic void subscribe(java.lang.String[] nativeApis, NativeApiObserver nativeApiObserver)
nativeApis
- nativeApi数组nativeApiObserver
- 当订阅的cnativeApi被触发了,会通知到nativeApiObserverpublic void subscribeSync(java.lang.String[] nativeApis, NativeApiObserver nativeApiObserver)
nativeApis
- nativeApi数组nativeApiObserver
- 当订阅的cnativeApi被触发了,会通知到nativeApiObserverpublic void subscribe(java.lang.String nativeApi, NativeApiObserver nativeApiObserver)
nativeApi
- 单个的nativeApinativeApiObserver
- 当订阅的cnativeApi被触发了,会通知到nativeApiObserverpublic void subscribe(java.lang.String[] messages, MessageObserver messageObserver)
messages
- message数组messageObserver
- 当订阅的messages被触发了,会通知到messageObserverpublic void subscribeSync(java.lang.String[] messages, MessageObserver messageObserver)
messages
- message数组messageObserver
- 当订阅的messages被触发了,会通知到messageObserverpublic void subscribe(java.lang.String message, MessageObserver messageObserver)
message
- 单个的messagemessageObserver
- 当订阅的message被触发了,会通知到messageObserverpublic void unSubscribe(CommandObserver observer)
observer
- observerpublic void unSubscribeSync(CommandObserver observer)
observer
- observerpublic void unSubscribe(NativeApiObserver observer)
observer
- observerpublic void unSubscribeSync(NativeApiObserver observer)
observer
- observerpublic void unSubscribe(MessageObserver observer)
observer
- observerpublic void unSubscribeSync(MessageObserver observer)
observer
- observerpublic void feedbackNativeApiResult(java.lang.String nativeApi, DuiWidget duiWidget)
nativeApi
- dui平台上技能定义的nativeapiduiWidget
- duiwidget实例public int getUiagentProt()
public java.lang.String getValidH5Path() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public java.lang.String[] getWakeupWords() throws DDSNotInitCompleteException
WakeupEngine.getWakeupWords()
获取当前的唤醒词DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public java.lang.String getMinorWakeupWord() throws DDSNotInitCompleteException
WakeupEngine.getMinorWakeupWord()
获取当前的副唤醒词DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void enableWakeup() throws DDSNotInitCompleteException
WakeupEngine.enableWakeup()
开启唤醒DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void disableWakeup() throws DDSNotInitCompleteException
WakeupEngine.disableWakeup()
关闭唤醒DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void startDialog() throws DDSNotInitCompleteException
播报提示音后进入识别。若当前正在对话中,会先结束当前对话,再开启新对话。
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void startDialog(org.json.JSONObject jsonObject) throws DDSNotInitCompleteException
播报提示音后进入识别。若当前正在对话中,会先结束当前对话,再开启新对话。
jsonObject
- 自定义配置信息,可以配置回复语greeting等DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void stopDialog() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void openTip() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void closeTip() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void stopDialog(org.json.JSONObject jsonObject) throws DDSNotInitCompleteException
jsonObject
- 自定义配置信息,可以配置合成文本,内部会在合成完该文本后停止当前对话DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void triggerIntent(java.lang.String skill, java.lang.String task, java.lang.String intent, java.lang.String slots) throws DDSNotInitCompleteException
跳过识别和语义,直接进入指定的意图对话
skill
- 技能名称, 必填task
- 任务名称, 必填intent
- 意图名称, 必填slots
- 语义槽, key-value Json, 可选DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void triggerIntent(SkillIntent skillIntent) throws DDSNotInitCompleteException
跳过识别和语义,直接进入指定的意图对话
skillIntent
- 技能意图DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void avatarClick() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void avatarClick(java.lang.String greeting) throws DDSNotInitCompleteException
greeting
- 在唤醒时附带一则欢迎语DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void avatarPress() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void avatarRelease() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String getResourceVersion()
@Deprecated public void speak(java.lang.String text, int priority) throws DDSNotInitCompleteException
TTSEngine.speak(String, int)
播报文本,支持SSML
当DDSConfig.K_TTS_MODE设置为"external"时,该接口无效,请直接调用外部TTS引擎的对应接口。
text
- 播报文本priority
- 优先级
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void speak(java.lang.String text, int priority, java.lang.String ttsId, int audioFocus) throws DDSNotInitCompleteException
TTSEngine.speak(String, int, String, int)
播报文本,支持SSML
当DDSConfig.K_TTS_MODE设置为"external"时,该接口无效,请直接调用外部TTS引擎的对应接口。
text
- 播报文本priority
- 优先级
ttsId
- 用于追踪该次播报的id,建议使用UUID.audioFocus
- 该次播报的音频焦
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void shutup(java.lang.String ttsId) throws DDSNotInitCompleteException
TTSEngine.shutup(String)
停止播报接口
当DDSConfig.K_TTS_MODE设置为"external"时,该接口无效,请直接调用外部TTS引擎的对应接口。
ttsId
- 和 speak(String, int, String, int)
ttsId.一致
ttsId与speak接口的ttsId一致,则停止或者移除该播报;
ttsId为空, 停止所有播报;
ttsId为"0",停止当前播报.DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void setAuthCode(AuthInfo authInfo, TokenListener tokenListener) throws DDSNotInitCompleteException
clearAuthCode()
tokenListener
- 返回成功和错误的信息DDSNotInitCompleteException
public void clearAuthCode() throws DDSNotInitCompleteException
setAuthCode(AuthInfo, TokenListener)
DDSNotInitCompleteException
public void setDDSMode(int mode) throws DDSNotInitCompleteException
mode
- 场景模式, 参考DDSMode
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void setDuplexMode(Agent.DuplexMode duplexMode) throws DDSNotInitCompleteException
duplexMode
- 策略 DuplexMode.HALF_DUPLEX:一问一答策略, DuplexMode.FULL_DUPLEX:全双工策略DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic Agent.DuplexMode getDuplexMode() throws DDSNotInitCompleteException
DDSNotInitCompleteException
public void setEnableVoip(boolean enableVoip) throws DDSNotInitCompleteException
enableVoip
- true/falseDDSNotInitCompleteException
public void feedPcm(byte[] pcm)
需要将DDSConfig.K_RECORDER_MODE设置为"external",该接口才会生效
pcm
- 音频数据public void feedSbc(byte[] sbc)
需要将DDSConfig.K_RECORDER_MODE设置为"external",该接口才会生效 并且需要提前调用: DDS.getInstance().getAgent().setRecorderMode(Agent.RecorderMode.SBC)
sbc
- sbc格式的音频数据public void feedOpus(byte[] opus)
需要将DDSConfig.K_RECORDER_MODE设置为"external",该接口才会生效 并且需要提前调用: DDS.getInstance().getAgent().setRecorderMode(Agent.RecorderMode.OPUS)
opus
- sbc格式的音频数据public void setRecorderMode(Agent.RecorderMode recorderMode) throws DDSNotInitCompleteException
需要将DDSConfig.K_RECORDER_MODE设置为"external",该接口才会生效
recorderMode
- 音频格式枚举DDSNotInitCompleteException
public void setTTSRequestListener(TTSRequestListener listener) throws DDSNotInitCompleteException
需要将DDSConfig.K_TTS_MODE设置为"external",该接口才会生效
listener
- TTS请求监听器。如果为空,则为解除注册DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void notifyTTSEnd()
播放完毕后,需要调用该接口才能自动进入下一轮识别
需要将DDSConfig.K_TTS_MODE设置为"external",该接口才会生效
public java.lang.String updateVocabs(VocabIntent... vocabs) throws DDSNotInitCompleteException
更新指定词库的词条。 更新结果可以通过sys.upload.result消息来获取。
vocabs
- 需要更新的词库列表DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionVocabIntent
public void updatePhraseHints(PhraseHintsIntent... phraseHints) throws DDSNotInitCompleteException
每次请求都会带上热词词库, 例如: [{"type": "vocab", "name": "行政区", "data":["黄浦区"]}] 本接口为覆盖式接口,以最新设置为准,如需要清除请求空参数即可
phraseHints
- 需要更新的热词识别列表DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionPhraseHintsIntent
@Deprecated public java.lang.String updateVocab(java.lang.String vocabName, java.lang.String[] contents, boolean addOrDelete) throws DDSNotInitCompleteException
updateVocabs(VocabIntent...)
DDSNotInitCompleteException
@Deprecated public java.lang.String updateDeviceInfo(java.lang.String deviceJson) throws DDSNotInitCompleteException
updateProductContext(ContextIntent)
}
updateSkillContext(ContextIntent)
}deviceJson
- 设备状态信息的Json串,例如:
{"bluetooth":{”state“:"disconnected"}},在技能中使用$context.bluetooth.state$将会获取到返回值"disconnected"DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String updateProductContext(ContextIntent intent) throws DDSNotInitCompleteException
intent
- 请求的ContextIntent对象,包括key和value
如:ContextIntent intent = new ContextIntent("location",{"city":"苏州市"});
updateProductContext(intent);
技能里通过$context.location.city$即可获取到"苏州市"DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String updateSkillContext(ContextIntent intent) throws DDSNotInitCompleteException
intent
- 请求的ContextIntent对象,包括key、value、skillId。DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public java.lang.String endSkillInDialog() throws DDSNotInitCompleteException
updateDispatchEvent(JSONObject)
}DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String updateDispatchEvent(org.json.JSONObject obj) throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.Object getProductContext(java.lang.String inputKey) throws DDSNotInitCompleteException
inputKey
- 配置项名称DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.Object getSkillContext(java.lang.String skillId, java.lang.String inputKey) throws DDSNotInitCompleteException
skillId
- 技能IDinputKey
- 配置项名称DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String clearDeviceInfo(java.lang.String key) throws DDSNotInitCompleteException
key
- 不为null时,清空指定key的设备信息,如"state"
为null时,清空所有设备信息DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.lang.String getDeviceInfo() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void updateMinorWakeupWord(java.lang.String word, java.lang.String pinyin, java.lang.String threshold, java.lang.String[] greetings) throws DDSNotInitCompleteException
WakeupEngine.updateMinorWakeupWord(String, String, String, String[])
更新副唤醒词的接口
支持设置一个副唤醒词,重复调用会以最新的副唤醒词为准
word
- 副唤醒词, 若设置null,则清空当前的副唤醒词pinyin
- 副唤醒词的拼音threshold
- 副唤醒词的阈值, 若设置null,则自动估算greetings
- 副唤醒词的欢迎语, 若设置null,则与主唤醒词保持一致DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic ASREngine getASREngine()
public TTSEngine getTTSEngine()
public WakeupEngine getWakeupEngine()
public VprintEngine getVprintEngine()
@Deprecated public void updateCommandWakeupWord(java.lang.String[] actions, java.lang.String[] words, java.lang.String[] pinyin, java.lang.String[] threshold, java.lang.String[][] greetings) throws DDSNotInitCompleteException
WakeupEngine.updateCommandWakeupWord(String[], String[], String[], String[], String[][])
更新命令唤醒词的接口,这类唤醒词会在唤醒之后执行一条指令,不能打断正在播报的语音
支持设置多个命令唤醒词,所以参数为数组,重复调用会以最新的命令唤醒词数组为准。
actions
- 命令唤醒词对应的command命令(必须)words
- 命令唤醒词的汉字(必须)pinyin
- 命令唤醒词的拼音(必须)threshold
- 命令唤醒词的阈值(必须greetings
- 命令唤醒词对应的唤醒语,一个唤醒词可以设置多条欢迎语,所以参数为二维数组,如果想要某个唤醒词不要欢迎语,那么该第二维数组的string可以设置为空字符串""DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void clearCommandWakeupWord() throws DDSNotInitCompleteException
WakeupEngine.clearCommandWakeupWord()
清空命令唤醒词的接口DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void clearShortCutWakeupWord() throws DDSNotInitCompleteException
WakeupEngine.clearShortCutWakeupWord()
清空打断唤醒词的接口DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void updateShortcutWakeupWord(java.lang.String[] words, java.lang.String[] pinyin, java.lang.String[] threshold) throws DDSNotInitCompleteException
WakeupEngine.updateShortcutWakeupWord(String[], String[], String[])
更新打断唤醒词的接口,这类唤醒词能打断正在播报的语音并且将唤醒词送入识别
支持设置多个打断唤醒词,所以参数为数组,重复调用会以最新的打断唤醒词数组为准。
words
- 打断唤醒词的汉字(必须)pinyin
- 打断唤醒词的拼音(必须)threshold
- 打断唤醒词的阈值(必须DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public boolean setVadPauseTime(long millis) throws DDSNotInitCompleteException
若VAD在用户说话时停顿超过一定的时间,则认为用户已经说完,发出sys.vad.end消息,结束录音。
millis
- 后端停顿时间,单位为毫秒。默认值为500毫秒。DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public long getVadPauseTime() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void sendText(java.lang.String text) throws DDSNotInitCompleteException
跳过对话中的识别过程,直接开始对话中的语义理解
若当前没有在对话中,则以文本作为首轮说法,新发起一轮对话请求 若当前正在对话中,则跳过识别,直接发送文本
text
- 输入的文本内容DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic java.util.List<SkillConfig> getSkillList() throws DDSNotInitCompleteException
DDSNotInitCompleteException
public void pauseDialog() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exceptionpublic void resumeDialog() throws DDSNotInitCompleteException
DDSNotInitCompleteException
- 如果DDS没有初始化完成,会抛出exception@Deprecated public void setDMCallback(DMCallback callback)
topic
的{setDMTaskCallback(DMTaskCallback)
}接口callback
- 对话监听器public void updatePermanentSkill(org.json.JSONArray jsonArray) throws DDSNotInitCompleteException
jsonArray
- skillId array,
[
{"skillId": "123123"},
{"skillId": "123123"},
{"skillId": "123123"},
]DDSNotInitCompleteException
public void setDMTaskCallback(DMTaskCallback dmTaskCallback)
dmTaskCallback
- 对话监听器public void setCustomTips(org.json.JSONObject obj) throws DDSNotInitCompleteException
obj
-
取值:JSON字符串,如:
{
"71304":"这是识别结果为空的自定义播报",
"71305":"这是语义结果为空的自定义播报",
"71308":"这是进入闲聊技能的自定义播报",
"713**":"*****"
}
DDSNotInitCompleteException
public void onNoObserverAttached(java.lang.String topic)
public void onFirstObserverAttached(java.lang.String topic)
public java.util.Set<java.lang.String> getSubscribedTopics()