IFlySpeechEventType Constants Reference
| Declared in | IFlySpeechEvent.h |
|---|
IFlySpeechEventType
事件类型
Definition
typedef NS_ENUM(NSUInteger, IFlySpeechEventType ) {
IFlySpeechEventTypeNetPref = 10001,
IFlySpeechEventTypeISTAudioFile = 10004,
IFlySpeechEventTypeISTUploadBytes = 10006,
IFlySpeechEventTypeISTCacheLeft = 10007,
IFlySpeechEventTypeISTResultTime = 10008,
IFlySpeechEventTypeISTSyncID = 10009,
IFlySpeechEventTypeSessionBegin = 10010,
IFlySpeechEventTypeSessionEnd = 10011,
IFlySpeechEventTypeVolume = 10012,
IFlySpeechEventTypeVadEOS = 10013,
IFlySpeechEventTypeSessionID = 20001,
IFlySpeechEventTypeTTSBuffer = 21001,
IFlySpeechEventTypeTTSCancel = 21002,
IFlySpeechEventTypeIVWResult = 22001,
IFlySpeechEventTypeSpeechStart = 22002,
IFlySpeechEventTypeRecordStop = 22003,
IFlySpeechEventTypeAudioUrl = 23001,
IFlySpeechEventTypeVoiceChangeResult = 24001,
};
Constants
IFlySpeechEventTypeNetPref-
网络状态消息
在消息到达时,可通过onEvent的第2个参数arg1,获取当前网络连接状态值Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeISTAudioFile-
转写音频文件消息
在录音模式下,成功创建音频文件时返回。可通过onEvent第4个参数data,指定Key为[IFlySpeechConstant IST_AUDIO_PATH],获取音频文件绝对路径.或通过[IFlySpeechTranscripter getParameter:[IFlySpeechConstant IST_AUDIO_PATH]],获取音频文件绝对路径.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeISTUploadBytes-
转写已上传字节消息
在消息到达时,通过onEvent的第二个参数arg1,获取已确认上传到服务器的字节数.若当前音频源为非写音频模式,还可通过onEvent 的第三个参数arg2,获取当前所有音频的字节大小.录音模式时,由于所有音频字节大小会变。当停止音频输入后(等待录音时间超时[IFlySpeechConstant SPEECH_TIMEOUT],或调用[IFlySpeechTranscripter stopTranscripting]),且服务器收到所有音频时,第四个参数data,将包含完成标记的布尔值(true),可通过data调用指定KEY为KCIFlySpeechEventKeyISTUploadComplete获取。此消息可能多次返回.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeISTCacheLeft-
转写缓存剩余
此消息仅在音频源为-1时需要关注,在调用[IFlySpeechTranscripter writeAudio]写音频时,应该关注此事件。
此事件在调用写音频接口、及音频最后被写入底库库时分别回调一次。当事件回调时,通过onEvent的第二个参数arg1,获取当前剩余的缓存大小,当缓存小于要写入的音频时,应该先暂停写音频数据,直到下次缓存大小大于要写入的音频时.最大缓存为128KByte。Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeISTResultTime-
转写结果等待时间消息
在消息到达时,通过 onEvent的第二个参数arg1,获取当前结果需要的时间.
此消息可能多次返回,返回时间不定,且不一定会返回.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeISTSyncID-
转写转写音频同步ID消息
在消息到达时,通过 onEvent的第二个参数arg1,获取当前写音频同步ID.
此消息可能多次返回.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeSessionBegin-
会话开始消息
在会话开始成功后返回Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeSessionEnd-
会话结束消息
在会话结束前返回Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeVolume-
音量消息,在得到音量时抛出,暂时只有身份验证的声纹业务用到
Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeVadEOS-
VAD后端点消息,在检测到VAD后端点时抛出,暂时只有身份验证的声纹业务用到
Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeSessionID-
服务端会话id
在消息到达时,可通过onEvent的第4个参数data(字典类型),指定key KCIFlySpeechEventKeySessionID,获取服务端会话id.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeTTSBuffer-
TTS合成数据消息
-(void)onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData
其中eventData中包含数据Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeTTSCancel-
通知cancel方法被调用的回调
Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeIVWResult-
IVW onshot 听写 or 识别结果
在消息到达时,第2个参数arg1包含是否为最后一个结果:1为是,0为否;
第4个参数data中包含数据,通过指定KEY为KCIFlySpeechEventKeyIVWResult获取.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeSpeechStart-
开始处理录音数据
Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeRecordStop-
录音停止
Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeAudioUrl-
服务端音频url
在消息到达时,第4个参数data,包含数据,通过指定KEY为KCIFlySpeechEventKeyAudioUrl获取.Declared In
IFlySpeechEvent.h. IFlySpeechEventTypeVoiceChangeResult-
变声数据结果返回
设置voice_change参数获取结果.Declared In
IFlySpeechEvent.h.
Declared In
IFlySpeechEvent.h