public class AILocalASREngine extends BaseEngine
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
mBaseProcessor, tagSuffix
Modifier and Type | Method and Description |
---|---|
void |
cancel()
取消本次识别操作
|
static AILocalASREngine |
createInstance() |
void |
destroy()
销毁本地识别引擎
|
void |
feed(byte[] data)
传入数据,在不使用SDK内部录音机时调用
|
void |
feedData(byte[] data,
int size)
传入数据,在不使用SDK内部录音机时调用
|
java.lang.String |
getTag() |
void |
init(AILocalASRConfig config,
AIASRListener listener)
初始化本地识别引擎
|
void |
notifyWakeup()
告知识别引擎已经唤醒,该接口在oneshot功能中使用,内部会记录唤醒的时间点,
之后在vad end的时候来判断到底用户说的是不是唤醒词+指令,还是只有唤醒词
|
void |
setWakeupWords(java.lang.String[] wakeupWords)
设置唤醒词列表,用于oneshot过滤唤醒词
|
void |
start(AILocalASRIntent aiLocalASRIntent)
启动录音,开始语音识别
|
void |
stop()
停止录音,等待识别结果
|
void |
updateDecoder(AIUpdateListener updateListener,
com.aispeech.export.engines2.bean.Decoder... decoders) |
void |
updateNetBinPath(java.lang.String netBinPath,
AIUpdateListener listener)
更新编译 xbnf 后的 netBin
|
void |
updateVocab(com.aispeech.export.Vocab vocab,
AIUpdateListener updateListener) |
void |
updateVocabs(AIUpdateListener updateListener,
com.aispeech.export.Vocab... vocabs)
更新单个或者多个词库
|
init, initTAG, parseConfig, parseIntent, start
public static final java.lang.String TAG
public java.lang.String getTag()
getTag
in class BaseEngine
public static AILocalASREngine createInstance()
public void notifyWakeup()
请参考 oneshot demo 中的使用方法
public void updateNetBinPath(java.lang.String netBinPath, AIUpdateListener listener)
listener
- 更新接口回调 AIUpdateListener
netBinPath
- net.bin 资源自定义路径public void init(AILocalASRConfig config, AIASRListener listener)
config
- 配置信息listener
- 回调接口public void setWakeupWords(java.lang.String[] wakeupWords)
wakeupWords
- 唤醒词列表public void start(AILocalASRIntent aiLocalASRIntent)
aiLocalASRIntent
- 参数public void feed(byte[] data)
data
- 音频数据流BaseIntent.setUseCustomFeed(boolean)
public void feedData(byte[] data, int size)
data
- 音频数据流size
- 数据大小BaseIntent.setUseCustomFeed(boolean)
public void stop()
stop
in class BaseEngine
public void cancel()
cancel
in class BaseEngine
public void destroy()
destroy
in class BaseEngine
public void updateVocab(com.aispeech.export.Vocab vocab, AIUpdateListener updateListener)
public void updateVocabs(AIUpdateListener updateListener, com.aispeech.export.Vocab... vocabs)
updateListener
- 更新结果回调vocabs
- 词库内容public void updateDecoder(AIUpdateListener updateListener, com.aispeech.export.engines2.bean.Decoder... decoders)