SpeechUnderstanderListener

Xunfei Voice+



com.iflytek.speech 接口 SpeechUnderstanderListener

所有超级接口:
android.os.IInterface
所有已知实现类:
SpeechUnderstanderListener.Stub

public interface SpeechUnderstanderListener
extends android.os.IInterface

语音到语义的回调接口。

作者:
iflytek

嵌套类摘要
static class SpeechUnderstanderListener.Stub
          Local-side IPC implementation stub class.
 
方法摘要
 void onBeginOfSpeech()
          录音启动回调。
 void onEndOfSpeech()
          录音自动停止回调。
 void onError(int errorCode)
          识别错误回调。
 void onResult(UnderstanderResult result)
          识别结果回调。
 void onVolumeChanged(int volume)
          音量变化回调,范围[0-30]
 
从接口 android.os.IInterface 继承的方法
asBinder
 

方法详细信息

onVolumeChanged

void onVolumeChanged(int volume)
                     throws android.os.RemoteException
音量变化回调,范围[0-30]

参数:
volume - 录音音量值,范围0-30
抛出:
android.os.RemoteException

onBeginOfSpeech

void onBeginOfSpeech()
                     throws android.os.RemoteException
录音启动回调。

说明:
1、录音正常启动后回调此函数。

抛出:
android.os.RemoteException

onEndOfSpeech

void onEndOfSpeech()
                   throws android.os.RemoteException
录音自动停止回调。

说明:
1、SpeechRecognizer内集成了端点检测功能,当用户一定时间内不说话,默认为用户已经不需要再录入语音,会自动调用此回调函数, 并停止当前录音。

抛出:
android.os.RemoteException

onResult

void onResult(UnderstanderResult result)
              throws android.os.RemoteException
识别结果回调。

说明:
1、SpeechRecognizer采用边录音边发送的方式,可能会多次返回结果。

参数:
result - 识别结果,请参考UnderstanderResult定义
抛出:
android.os.RemoteException

onError

void onError(int errorCode)
             throws android.os.RemoteException
识别错误回调。

参数:
errorCode - 错误码,详细错误码请看ErrorCode
抛出:
android.os.RemoteException