类 AILocalASREngine


  • public class AILocalASREngine
    extends java.lang.Object
    本地识别
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static java.lang.String TAG  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void cancel()
      取消本次识别操作
      static AILocalASREngine createInstance()  
      void destroy()
      销毁本地识别引擎
      void feed​(byte[] data)
      传入数据,在不使用SDK内部录音机时调用
      void feedData​(byte[] data, int size)
      传入数据,在不使用SDK内部录音机时调用
      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)
      更新单个或者多个词库
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • TAG

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

      • 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()
        停止录音,等待识别结果
      • cancel

        public void cancel()
        取消本次识别操作
      • destroy

        public void destroy()
        销毁本地识别引擎
      • 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)