@property (assign) id<IFlyISVDelegate> delegate+ (instancetype)sharedInstance- (NSString *)generatePassword:(int)length- (NSArray *)getPasswordList:(int)pwdt- (BOOL)isListening- (BOOL)sendRequest:(NSString *)cmd authid:(NSString *)auth_id pwdt:(int)pwdt ptxt:(NSString *)ptxt vid:(NSString *)vid err:(int *)err| name | desc |
|---|---|
| cmd | “del”: delete model; “que”: query model; |
| pwdt | voiceprint type 1: fixed txt voiceprint code ,like @“我的地盘我做主”; 2: free voiceprint code , user can speek anything,but 5 times trainning the speech shall be same; 3: number serial voiceprint code ,like @“98765432” and so on. |
| ptxt | voiceprint txt,only fixed voiceprint and number serial have this,in free voiceprint model this param shall be set nil. |
| vid | another voiceprint type model,user can use this to query or delete model in server can be @“jakillasdfasdjjjlajlsdfhdfdsadff”,totally 32 bits; NOTES: when vid is not nil,then the server will judge the vid first; while the vid is nil, server can still query or delete the voiceprint model by other params. |
| authid: | user id ,can be @“tianxia” or other; |
- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key| name | desc |
|---|---|
| value | 参数值 |
| key | 参数类型 |
| key | value |
|---|---|
| sst | @“train” or @“verify” |
| auth_id | @“tianxia” or other |
| sub | @“ivp” |
| ptxt | |
| rgn | @“5” |
| pwdt | @“1”,or @“2”, or @“3” |
| auf | @“audio/L16;rate=16000” or @“audio/L16;rate=8000” |
| vad_enable | @“1” or @“0” |
| vad_timeout | @“3000” |
| vad_speech_tail | @“100” |
- (NSString *)getParameter:(NSString *)key- (void)startListeningStop recording- (void)cancel@property (nonatomic, retain) NSString *result+ (instancetype)identityResultWithString:(NSString *)jsonString| name | desc |
|---|---|
| jsonString | json字符串 |
- (NSDictionary *)dictionaryResults@property (nonatomic, assign) id<IFlyIdentityVerifierDelegate> delegate+ (instancetype)sharedInstance+ (void)purgeSharedInstance- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key| name | desc |
|---|---|
| value | 参数值 |
| key | 参数名 |
- (void)startWorking- (void)write:(NSString *)ssub data:(NSData *)data offset:(int)offset length:(int)length withParams:(NSString *)params| name | desc |
|---|---|
| ssub | 子业务名 |
| data | 数据 |
| offset | 偏移量 |
| length | 长度 |
| params | 见下表 |
| ifr参数 | 描述 |
|---|---|
| data_format | 数据格式:即图片格式,支持jpg(默认),gif |
| data_encoding | 数据压缩编码:即图片压缩编码,支持raw(不压缩,默认值) |
| wtt | 等待超时时间: 支持大于0的整数,默认为3000ms |
| ivp参数 | 描述 |
| rgn | 训练次数:取值2~9.无默认值,必须明确指定。 |
| tsd | 声纹确认门限值,验证得分>=tsd验证通过,否则验证失败(该参数目前不支持,作为保留参数。)却只范围:0~100. |
| ptxt | 密码文本。从服务端下载,比如数字密码所需要的数字串。 |
| pwdt | 密码类型。取值:1(文本密码),2(自由说),3(数字密码). |
| fin | 取消注册。取值:0(不取消,即不 生效),1(取消本次注册). |
| wtt | 等待超时时间:描述客户端等待结果的超时时间. |
| vad_enable | VAD功能开关。是否启用VAD处理,取值:1(开启,默认),0(不开启)。 |
| vad_bos | 头部静音最大长度。如果静音长度超过此值,则认为用户此次无有效音频输入。 此参数仅在打开VAD功能时生效。(云端暂时没有)。 取值:0~30000ms,默认为10000ms |
| vad_eos | 尾部静音长度。如果尾部静音长度超过了此值,则认为音频已经结束。 此参数仅在打开VAD功能时生效。(云端暂时没有)。 取值:0~30000ms,默认为2000ms |
| data_encoding | 数据压缩编码,音频压缩编码。 |
| data_format | 在声纹业务中为音频采样率,取值:16000(默认),8000 |
| ipt参数 | 描述 |
| scope | 操作范围 person,group |
| group_id | 指定鉴别的组数字或者字符串,唯一值 不为空 |
| group_name | 组名称 “”或者不能包含^@,&=*'"等非法字符,且长度不得超过255.此参数可以为空,对于group_name约束不在云端控制,由前段控制 |
| topc | 组名称[top candidates],返回得分最高的候选人数目 取值1-5 默认是1.可以开放由用户设置,最大topc值为5 |
- (void)stopWrite:(NSString *)ssub| name | desc |
|---|---|
| ssub | 子业务名:ivp,ifr,ipt |
- (void)execute:(NSString *)ssub cmd:(NSString *)cmd params:(NSString *)params| name | desc |
|---|---|
| ssub | 子业务类型、可选值:ivp(声纹)、ifr(人脸)、ipt(鉴别) |
| cmd | 操作命令,可选值:query、delete、download、add |
| params | 子业务参数,参见write:data:offset:length:withParams: |
- (void)cancel+ (NSString *)generateNumberPassword:(int)length| name | desc |
|---|---|
| length | 随机字符串长度 |
+ (UIImage *)ARGBToGray:(UIImage *)sourceImage| name | desc |
|---|---|
| sourceImage | ARGB彩图 |
- (void)onResult:(NSDictionary *)dic| name | desc |
|---|---|
| dic | 结果 |
- (void)onCompleted:(IFlySpeechError *)errorCode| name | desc |
|---|---|
| errorCode | 错误码 |
- (void)onRecognition- (void)onVolumeChanged:(int)volume| name | desc |
|---|---|
| volume | 音量值 |
- (void)onCompleted:(IFlySpeechError *)error| name | desc |
|---|---|
| error | 错误描述类 |
- (void)onResults:(IFlyIdentityResult *)results isLast:(BOOL)isLast| name | desc |
|---|---|
| results | -[out] 结果。 |
| isLast | -[out] 是否最后一条结果 |
- (void)onEvent:(int)eventType arg1:(int)arg1 arg2:(int)arg2 extra:(id)obj| name | desc |
|---|---|
| eventType | 消息类型 |
| arg1 | eventType为 Event_volume 时 arg1为音量值 |
| arg2 | 参数2 |
| obj | 扩展参数 |