这里介绍的是iOS API关于语音唤醒(Wakeuper)的相关说明,点击右侧目录可快速找到相应文件。
Inherits from | NSObject |
---|---|
Declared in | IFlyVoiceWakeuper.h |
音频流唤醒可以将文件分段写入
代理
@property (nonatomic, assign) id<IFlyVoiceWakeuperDelegate> delegate
Declared In
IFlyVoiceWakeuper.h
是否正在唤醒
@property (nonatomic, readonly) BOOL isListening
Declared In
IFlyVoiceWakeuper.h
创建唤醒实例,采用单例模式
+ (instancetype)sharedInstance
Declared In
IFlyVoiceWakeuper.h
启动唤醒 返回值:YES 成功,NO:失败
- (BOOL)startListening
Declared In
IFlyVoiceWakeuper.h
停止录音
- (BOOL)stopListening
Declared In
IFlyVoiceWakeuper.h
取消唤醒会话
- (BOOL)cancel
Declared In
IFlyVoiceWakeuper.h
获取工作参数
- (NSString *)getParameter:(NSString *)key
Declared In
IFlyVoiceWakeuper.h
设置工作参数
注意服务正在运行中,不能设置参数
- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key
Declared In IFlyVoiceWakeuper.h
写入音频流
- (BOOL)writeAudio:(NSData *)audioData
Parameters
audioData | 音频数据 |
---|
Return Value
写入成功返回YES,写入失败返回NO
Declared In
IFlyVoiceWakeuper.h
Conforms to | NSObject |
---|---|
Declared in | IFlyVoiceWakeuperDelegate.h |
录音开始
- (void)onBeginOfSpeech
Declared In
IFlyVoiceWakeuperDelegate.h
录音结束
- (void)onEndOfSpeech
Declared In
IFlyVoiceWakeuperDelegate.h
会话错误
- (void)onCompleted:(IFlySpeechError *)error
Parameters
errorCode | 错误描述类 |
---|
Declared In
IFlyVoiceWakeuperDelegate.h
唤醒结果
- (void)onResult:(NSMutableDictionary *)resultDic
Parameters
resultDic | 唤醒结果字典 |
---|
Declared In:
IFlyVoiceWakeuperDelegate.h
音量反馈,返回频率与录音数据返回回调频率一致
- (void)onVolumeChanged:(int)volume
Parameters
volume | 音量值 |
---|
Declared In
IFlyVoiceWakeuperDelegate.h
扩展事件回调
根据事件类型返回额外的数据
- (void)onEvent:(int)eventType isLast:(BOOL)isLast arg1:(int)arg1 data:(NSMutableDictionary *)eventData
Parameters
eventType | 事件类型,具体参见IFlySpeechEvent枚举。 |
---|
Declared In
IFlyVoiceWakeuperDelegate.h