类 AILocalASREngine


  • public class AILocalASREngine
    extends BaseEngine
    本地识别
    • 字段详细资料

      • TAG

        public static final java.lang.String TAG
        另请参阅:
        常量字段值
    • 方法详细资料

      • getTag

        public java.lang.String getTag()
        指定者:
        getTag 在类中 BaseEngine
      • notifyWakeup

        public void notifyWakeup()
        告知识别引擎已经唤醒,该接口在oneshot功能中使用,内部会记录唤醒的时间点, 之后在vad end的时候来判断到底用户说的是不是唤醒词+指令,还是只有唤醒词

        请参考 oneshot demo 中的使用方法

      • updateNetBinPath

        public void updateNetBinPath​(java.lang.String netBinPath,
                                     AIUpdateListener listener)
        更新编译 xbnf 后的 netBin
        参数:
        listener - 更新接口回调 AIUpdateListener
        netBinPath - net.bin 资源自定义路径
      • init

        public void init​(AILocalASRConfig config,
                         AIASRListener listener)
        初始化本地识别引擎
        参数:
        config - 配置信息
        listener - 回调接口
      • setWakeupWords

        public void setWakeupWords​(java.lang.String[] wakeupWords)
        设置唤醒词列表,用于oneshot过滤唤醒词
        参数:
        wakeupWords - 唤醒词列表
      • start

        public void start​(AILocalASRIntent aiLocalASRIntent)
        启动录音,开始语音识别
        参数:
        aiLocalASRIntent - 参数
      • feedData

        public void feedData​(byte[] data,
                             int size)
        传入数据,在不使用SDK内部录音机时调用
        参数:
        data - 音频数据流
        size - 数据大小
        另请参阅:
        AILocalASRIntent.setUseCustomFeed(boolean)
      • stop

        public void stop()
        停止录音,等待识别结果
        覆盖:
        stop 在类中 BaseEngine
      • cancel

        public void cancel()
        取消本次识别操作
        覆盖:
        cancel 在类中 BaseEngine
      • destroy

        public void destroy()
        销毁本地识别引擎
        覆盖:
        destroy 在类中 BaseEngine
      • updateVocab

        public void updateVocab​(com.aispeech.export.Vocab vocab,
                                AIUpdateListener updateListener)
      • updateVocabs

        public void updateVocabs​(AIUpdateListener updateListener,
                                 com.aispeech.export.Vocab... vocabs)
        更新单个或者多个词库
        参数:
        updateListener - 更新结果回调
        vocabs - 词库内容
      • updateDecoder

        public void updateDecoder​(AIUpdateListener updateListener,
                                  com.aispeech.export.engines2.bean.Decoder... decoders)