public interface SpeechClientListener
限定符和类型 | 方法和说明 |
---|---|
void |
onError(int errorCode)
当执行出错时会回调。
|
void |
onFinalTranscription(java.lang.String result)
语音识别最终结果返回,比如“今天天气怎么样”,会按顺序返回“今天”,“今天天气”,“今天天气怎么样”,
最后一个就是Final Transcription。
|
void |
onLocalSilenceDetected()
在检测到本地语音之后,又检测到本地静音时回调。
|
void |
onNoSpeechDetected()
一段时间未检测到本地语音时回调。
|
void |
onPartialTranscription(java.lang.String fixedContent)
语音识别部分结果返回,比如“今天天气怎么样”,会按顺序返回“今天”,“今天天气”。
|
void |
onRemoteSilenceDetected()
服务器端检测到静音(说话人停止说话)后回调。
|
void |
onResult(java.lang.String result)
语音搜索结果返回, 为JSON格式字符串。
|
void |
onSpeechDetected()
检测到本地语音时回调。
|
void |
onStartRecord()
开始提供录音数据给语音识别引擎时回调。
|
void |
onVolume(double volume)
输入语音数据实时的音量回调。
|
void onStartRecord()
void onRemoteSilenceDetected()
void onVolume(double volume)
volume
- 根据语音的能量算出,单位为db, 范围为[0, 60]。void onPartialTranscription(java.lang.String fixedContent)
fixedContent
- 识别到的部分结果字符串。void onFinalTranscription(java.lang.String result)
result
- 最终认为用户说的完整字符串。void onResult(java.lang.String result)
result
- 语音搜索结果json。void onError(int errorCode)
errorCode
- 错误码,See ErrorCode
。void onLocalSilenceDetected()
void onNoSpeechDetected()
void onSpeechDetected()