setting alipay wechat success appmanage dollor user cart order workorder logout left1 left2 app unfree free chart coupon note copy pencil price-tag database cog bin list link plus minus codepen 审核 cross table search user-tie eye github cancel-circle checkmark icon-upload icon-smartphon icon-auth-user icon-arroba-symbol icon-check-pass icon-red-cross icon-pwd-key icon-used icon-expired android appleinc tux windows8 java webAPI mail vip

iOS 语音唤醒(Wakeuper)

这里介绍的是iOS API关于语音唤醒(Wakeuper)的相关说明,点击右侧目录可快速找到相应文件。

类IFlyVoiceWakeuper

Inherits from NSObject
Declared in IFlyVoiceWakeuper.h

语音唤醒

音频流唤醒

音频流唤醒可以将文件分段写入

Other Methods

delegate

代理

@property (nonatomic, assign) id<IFlyVoiceWakeuperDelegate> delegate

Declared In
IFlyVoiceWakeuper.h

isListening

是否正在唤醒

@property (nonatomic, readonly) BOOL isListening

Declared In
IFlyVoiceWakeuper.h

+ sharedInstance

创建唤醒实例,采用单例模式

+ (instancetype)sharedInstance

Declared In
IFlyVoiceWakeuper.h

– startListening

启动唤醒 返回值:YES 成功,NO:失败

- (BOOL)startListening

Declared In
IFlyVoiceWakeuper.h

– stopListening

停止录音

- (BOOL)stopListening

Declared In
IFlyVoiceWakeuper.h

– cancel

取消唤醒会话

- (BOOL)cancel

Declared In
IFlyVoiceWakeuper.h

– getParameter:

获取工作参数

- (NSString *)getParameter:(NSString *)key

Declared In
IFlyVoiceWakeuper.h

– setParameter:forKey:

设置工作参数
注意服务正在运行中,不能设置参数

- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key

Declared In IFlyVoiceWakeuper.h

IFlyStreamVoiceWakeuper Methods

– writeAudio:

写入音频流

- (BOOL)writeAudio:(NSData *)audioData

Parameters

audioData 音频数据

Return Value
写入成功返回YES,写入失败返回NO

Declared In
IFlyVoiceWakeuper.h

协议IFlyVoiceWakeuperDelegate

Conforms to NSObject
Declared in IFlyVoiceWakeuperDelegate.h

– onBeginOfSpeech

录音开始

- (void)onBeginOfSpeech

Declared In
IFlyVoiceWakeuperDelegate.h

– onEndOfSpeech

录音结束

- (void)onEndOfSpeech

Declared In
IFlyVoiceWakeuperDelegate.h

– onCompleted:

会话错误

- (void)onCompleted:(IFlySpeechError *)error

Parameters

errorCode 错误描述类

Declared In
IFlyVoiceWakeuperDelegate.h

– onResult:

唤醒结果

- (void)onResult:(NSMutableDictionary *)resultDic

Parameters

resultDic 唤醒结果字典

Declared In:
IFlyVoiceWakeuperDelegate.h

– onVolumeChanged:

音量反馈,返回频率与录音数据返回回调频率一致

- (void)onVolumeChanged:(int)volume

Parameters

volume 音量值

Declared In
IFlyVoiceWakeuperDelegate.h

– onEvent:isLast:arg1:data:

扩展事件回调
根据事件类型返回额外的数据

- (void)onEvent:(int)eventType isLast:(BOOL)isLast arg1:(int)arg1 data:(NSMutableDictionary *)eventData

Parameters

eventType 事件类型,具体参见IFlySpeechEvent枚举。

Declared In
IFlyVoiceWakeuperDelegate.h