public class OneshotKernel
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
static class |
OneshotKernel.EngineState
类说明: 引擎内部状态列表
|
Modifier and Type | Field and Description |
---|---|
static int |
INTERVAL |
protected AIErrorProcessor |
mErrorProcessor |
protected MessageQueue |
mQueue |
Constructor and Description |
---|
OneshotKernel(OneshotListener listener) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearMessage() |
protected int |
copyAssetsRes(AIEngineConfig config)
拷贝assets目录下的制定资源
|
void |
feed(byte[] data)
feed音频
|
protected void |
innerRelease() |
void |
newKernel(OneshotConfig config)
创建引擎
|
void |
notifyWakeup(java.lang.String word)
通知主唤醒词唤醒消息
|
void |
onBufferReceived(byte[] data) |
void |
onError(AIError error) |
void |
onInit(int status) |
void |
onRawDataReceived(byte[] buffer,
int size) |
void |
onReadyForSpeech() |
void |
onResultDataReceived(byte[] buffer,
int size,
int wakeupType) |
void |
onResults(java.lang.String result) |
void |
onRmsChanged(float rmsDb) |
void |
onVadEnd(java.lang.String recordID) |
void |
onVadStart(java.lang.String recordID) |
void |
releaseKernel()
释放引擎
|
void |
run() |
protected void |
semaphoreP() |
protected void |
semaphoreV() |
protected void |
sendMessage(Message msg) |
protected void |
showErrorMessage(com.aispeech.auth.ProfileState state) |
protected void |
trackInvalidState(java.lang.String msg) |
protected void |
transferState(OneshotKernel.EngineState nextState) |
protected Message |
waitMessage() |
protected MessageQueue mQueue
protected AIErrorProcessor mErrorProcessor
public static final int INTERVAL
public OneshotKernel(OneshotListener listener)
public void newKernel(OneshotConfig config)
config
- public void feed(byte[] data)
data
- 音频数据public void notifyWakeup(java.lang.String word)
word
- 唤醒词信息public void releaseKernel()
public void onReadyForSpeech()
public void onResultDataReceived(byte[] buffer, int size, int wakeupType)
public void onRawDataReceived(byte[] buffer, int size)
public void run()
run
in interface java.lang.Runnable
protected void trackInvalidState(java.lang.String msg)
protected void transferState(OneshotKernel.EngineState nextState)
public void onInit(int status)
public void onVadStart(java.lang.String recordID)
public void onVadEnd(java.lang.String recordID)
public void onRmsChanged(float rmsDb)
public void onBufferReceived(byte[] data)
public void onResults(java.lang.String result)
public void onError(AIError error)
protected void showErrorMessage(com.aispeech.auth.ProfileState state)
protected void innerRelease()
protected void clearMessage()
protected void sendMessage(Message msg)
protected Message waitMessage()
protected void semaphoreP()
protected void semaphoreV()
protected int copyAssetsRes(AIEngineConfig config)
config
- 配置