diff --git a/src/android/libs/Msc.jar b/src/android/libs/Msc.jar index 2dce377..fe502fb 100644 Binary files a/src/android/libs/Msc.jar and b/src/android/libs/Msc.jar differ diff --git a/src/android/libs/arm64-v8a/libmsc.so b/src/android/libs/arm64-v8a/libmsc.so index 307dbc9..059994c 100644 Binary files a/src/android/libs/arm64-v8a/libmsc.so and b/src/android/libs/arm64-v8a/libmsc.so differ diff --git a/src/android/libs/armeabi-v7a/libmsc.so b/src/android/libs/armeabi-v7a/libmsc.so index a97128f..7530755 100644 Binary files a/src/android/libs/armeabi-v7a/libmsc.so and b/src/android/libs/armeabi-v7a/libmsc.so differ diff --git a/src/ios/iflyMSC.framework/Headers/IFlyContact.h b/src/ios/iflyMSC.framework/Headers/IFlyContact.h new file mode 100644 index 0000000..a251f87 --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyContact.h @@ -0,0 +1,24 @@ +// +// IFlyContact.h +// msc +// +// Created by ypzhao on 13-3-1. +// Copyright (c) 2013年 IFLYTEK. All rights reserved. +// + +#import + +/*! + * 此接口为获取通信录中的联系人。
+ * 获取联系人是为了在进行语音识别时(sms)能更好的识别出您说的人名,联系人上传是属于个性化的一部分。 + */ +@interface IFlyContact : NSObject + +/*! + * 获取联系人。
+ * 调用此方法需要添加 AddressBook.framework 和 Contacts.framework到工程中,调用此方法后可以直接将通信录中的联系人转化为语音云识别的数据结构。您可以将获取的数据通过IFlyDataUploader类,上传到语音云,我们只获取通信录中的人名。 + * + * @return 返回联系人信息 + */ +- (NSString *) contact; +@end diff --git a/src/ios/iflyMSC.framework/Headers/IFlyIdentityResult.h b/src/ios/iflyMSC.framework/Headers/IFlyIdentityResult.h new file mode 100644 index 0000000..c43432a --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyIdentityResult.h @@ -0,0 +1,37 @@ +// +// IFlyIdentityResult.h +// IFlyMSC +// +// Created by 张剑 on 15/5/14. +// Copyright (c) 2015年 iflytek. All rights reserved. +// + +#import + +/** + * 身份验证结果类 + */ +@interface IFlyIdentityResult : NSObject + +/** + * json字符串格式结果 + */ +@property(nonatomic,retain)NSString* result; + +/** + * 创建身份验证结果类实例 + * + * @param jsonString json字符串 + * + * @return 身份验证结果类实例 + */ ++(instancetype)identityResultWithString:(NSString*)jsonString; + +/** + * 返回字典格式的结果 + * + * @return 字典格式的结果 + */ +-(NSDictionary*)dictionaryResults; + +@end diff --git a/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifier.h b/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifier.h new file mode 100644 index 0000000..be23ffa --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifier.h @@ -0,0 +1,176 @@ +// +// IFlyIdentityVerifier.h +// IFlyMSC +// +// Created by 张剑 on 15/4/22. +// Copyright (c) 2015年 iflytek. All rights reserved. +// + + +#import +#import "IFlyIdentityVerifierDelegate.h" + +/** + * 身份验证功能类 + */ +@interface IFlyIdentityVerifier : NSObject + +/*! + * 设置委托对象 + */ +@property (nonatomic, assign) id delegate; + +/** + * 返回身份验证对象的单例 + * + * @return 身份验证对象的单例 + */ ++ (instancetype) sharedInstance; + +/** + * 销毁身份验证对象单例。 + * + * @return 成功返回YES,失败返回NO。 + */ ++ (void)purgeSharedInstance; + +/** + * 设置参数 + * + * @param value 参数值 + * @param key 参数名 + * + * @return 设置的参数和取值正确返回YES,失败返回NO + */ +- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key; + +/** + * 开始会话 + * 在这之后会开始各项业务。 + */ +- (void)startWorking; + +/* + * | ------------- |----------------------------------------------------------- + * | 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功能时生效。(云端暂时没有)。取值:0~30000ms, + * | vad_eos |默认为2000ms + * | ------------- |----------------------------------------------------------- + * | data_encoding |数据压缩编码,音频压缩编码。 + * | ------------- |----------------------------------------------------------- + * | data_format |在声纹业务中为音频采样率,取值:16000(默认),8000 + * | ------------- |----------------------------------------------------------- + * | ipt 参数 | 描述 + * | ------------- |----------------------------------------------------------- + * | scope |操作范围 person,group + * | ------------- |----------------------------------------------------------- + * | group_id |指定鉴别的组数字或者字符串,唯一值 不为空 + * | ------------- |----------------------------------------------------------- + * | |组名称 “”或者不能包含^@,&=*'"等非法字符,且长度不得超过255. + * | group_name |此参数可以为空,对于group_name约束不在云端控制,由前段控制 + * | ------------- |----------------------------------------------------------- + * | topc |[top candidates],返回得分最高的候选人数目 取值1-5 默认是1. + * | | 可以开放由用户设置,最大topc值为5 + * | ------------- |----------------------------------------------------------- + * + */ + +/** + * 写入子业务数据、或者进行模型操作、下载密码。 + * + * @param ssub 子业务名 + * @param data 数据 + * @param offset 偏移量 + * @param length 长度 + * @param 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_enableVAD功能开关。是否启用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)write:(NSString*)ssub data:(NSData*)data offset:(int)offset length:(int)length withParams:(NSString*)params; + +/** + * 停止子业务数据写入 + * + * @param ssub 子业务名:ivp,ifr,ipt + */ +-(void)stopWrite:(NSString*)ssub; + +/** + * 执行模型查询、删除和声纹密码下载等操作 + * *注意此方法不能与startWorking方法同时使用。 + * + * @param ssub 子业务类型、可选值:ivp(声纹)、ifr(人脸)、ipt(鉴别) + * @param cmd 操作命令,可选值:query、delete、download、add + * @param params 子业务参数,参见write:data:offset:length:withParams: + */ +-(void)execute:(NSString*)ssub cmd:(NSString*)cmd params:(NSString*)params; + +/** + * 取消本次会话 + */ +- (void)cancel; + +@end + diff --git a/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifierDelegate.h b/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifierDelegate.h new file mode 100644 index 0000000..6daedef --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyIdentityVerifierDelegate.h @@ -0,0 +1,47 @@ +// +// IFlyIdentityVerifierDelegate.h +// IFlyMSC +// +// Created by 张剑 on 15/4/22. +// Copyright (c) 2015年 iflytek. All rights reserved. +// + + + +#import + +@class IFlySpeechError; +@class IFlyIdentityResult; + +/** + * 身份验证功能类回调 + */ +@protocol IFlyIdentityVerifierDelegate + +/*! + * 错误回调 + * + * @param error 错误描述类 + */ +- (void)onCompleted:(IFlySpeechError *)error; + +/*! + * 结果回调 + * + * @param results -[out] 结果。 + * @param isLast -[out] 是否最后一条结果 + */ +- (void)onResults:(IFlyIdentityResult *)results isLast:(BOOL)isLast; + +/** + * 扩展接口,用于抛出音量和vad_eos消息 + * + * @param eventType 消息类型 + * @param arg1 eventType为 Event_volume 时 arg1为音量值 + * @param arg2 参数2 + * @param obj 扩展参数 + */ +- (void)onEvent:(int)eventType arg1:(int)arg1 arg2:(int)arg2 extra:(id)obj; + +@end + diff --git a/src/ios/iflyMSC.framework/Headers/IFlyMSC.h b/src/ios/iflyMSC.framework/Headers/IFlyMSC.h index d956909..f8d81ff 100644 --- a/src/ios/iflyMSC.framework/Headers/IFlyMSC.h +++ b/src/ios/iflyMSC.framework/Headers/IFlyMSC.h @@ -12,6 +12,9 @@ #import "IFlyAudioSession.h" #import "IFlyDataUploader.h" #import "IFlyDebugLog.h" +#import "IFlyIdentityVerifier.h" +#import "IFlyIdentityResult.h" +#import "IFlyIdentityVerifierDelegate.h" #import "IFlyISVDelegate.h" #import "IFlyISVRecognizer.h" #import "IFlyRecognizerView.h" @@ -30,9 +33,8 @@ #import "IFlySpeechUtility.h" #import "IFlyUserWords.h" #import "IFlyPcmRecorder.h" +#import "IFlyVerifierUtil.h" #import "IFlyVoiceWakeuper.h" #import "IFlyVoiceWakeuperDelegate.h" - - #endif diff --git a/src/ios/iflyMSC.framework/Headers/IFlySpeechConstant.h b/src/ios/iflyMSC.framework/Headers/IFlySpeechConstant.h index 0166dca..d3bac9f 100644 --- a/src/ios/iflyMSC.framework/Headers/IFlySpeechConstant.h +++ b/src/ios/iflyMSC.framework/Headers/IFlySpeechConstant.h @@ -91,6 +91,41 @@ */ +(NSString*)LANGUAGE_ENGLISH; +/*! + * 语言 + * + * @return 俄语value + */ ++(NSString*)LANGUAGE_RUSSIAN; + +/*! + * 语言 + * + * @return 日语value + */ ++(NSString*)LANGUAGE_JAPANESE; + +/*! + * 语言 + * + * @return 法语value + */ ++(NSString*)LANGUAGE_FRENCH; + +/*! + * 语言 + * + * @return 西班牙语value + */ ++(NSString*)LANGUAGE_SPANISH; + +/*! + * 语言 + * + * @return 韩语value + */ ++(NSString*)LANGUAGE_KOREAN; + /*! * 返回结果的数据格式,可设置为json,xml,plain,默认为json。 * @@ -196,6 +231,13 @@ */ +(NSString*)ENGINE_TYPE; +/*! + * 本地xtts识别引擎。 + * + * @return 本地识别引擎value。 + */ ++(NSString*)TYPE_LOCAL_XTTS; + /*! * 本地识别引擎。 * diff --git a/src/ios/iflyMSC.framework/Headers/IFlySpeechUnderstander.h b/src/ios/iflyMSC.framework/Headers/IFlySpeechUnderstander.h new file mode 100644 index 0000000..3dbd3b9 --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlySpeechUnderstander.h @@ -0,0 +1,132 @@ +// +// IFlySpeechUnderstander.h +// MSC +// +// Created by iflytek on 2014-03-12. +// Copyright (c) 2014年 iflytek. All rights reserved. +// + +#import + +@class IFlySpeechError; +@protocol IFlySpeechRecognizerDelegate; + +/*! + * 语义理解接口 + */ +@interface IFlySpeechUnderstander : NSObject + +/*! + * 是否正在语义理解 + */ +@property (readonly) BOOL isUnderstanding; + +/*! + * 设置委托对象 + */ +@property(nonatomic,retain) id delegate ; + +/*! + * 创建语义理解对象的单例 + * + * @return 语义理解对象 + */ ++(instancetype) sharedInstance; + +/*! + * 开始义理解 + * + * 同时只能进行一路会话,这次会话没有结束不能进行下一路会话,否则会报错。若有需要多次回话,请在onCompleted回调返回后请求下一路回话。 + * + * @return 成功返回YES,失败返回NO + */ +- (BOOL) startListening; + +/*! + * 停止录音
+ * 调用此函数会停止录音,并开始进行语义理解 + */ +- (void) stopListening; + +/*! + * 取消本次会话 + */ +- (void) cancel; + +/* + * | ------------- |----------------------------------------------------------- + * | 参数 | 描述 + * | ------------- |----------------------------------------------------------- + * | domain |应用的领域: 取值为:iat、search、video、poi、music、asr; + * | | iat:普通文本听写; + * | | search:热词搜索; + * | | video:视频音乐搜索; + * | | asr:关键词识别; + * | ------------- |----------------------------------------------------------- + * | vad_bos |前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms; + * | | engine指定iat识别默认值为5000; + * | | 其他情况默认值为 4000,范围 0-10000。 + * | ------------- |----------------------------------------------------------- + * | vad_eos |后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入, + * | | 自动停止录音;单位:ms; + * | | sms 识别默认值为 1800; + * | | 其他默认值为 700,范围 0-10000。 + * | ------------- |----------------------------------------------------------- + * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 + * | ------------- |----------------------------------------------------------- + * | asr_ptt |标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。 + * | ------------- |----------------------------------------------------------- + * | result_type |返回结果的数据格式: 可设置为json,xml,plain,默认为json。 + * | ------------- |----------------------------------------------------------- + * | grammarID |识别的语法id: 只针对 domain 设置为”asr”的应用。 + * | ------------- |----------------------------------------------------------- + * | asr_audio_path|音频文件名: 设置此参数后,将会自动保存识别的录音文件。 + * | | 路径为Documents/(指定值)。 + * | | 不设置或者设置为nil,则不保存音频。 + * | ------------- |----------------------------------------------------------- + * | params |扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。 + * | ------------- |----------------------------------------------------------- + * + */ + +/*! + * 设置语义理解引擎的参数 + * + * 语义理解的引擎参数(key)取值如下: + * + * | 参数 | 描述 | + * |-----------------|-------------------------------------------------------| + * | domain | 应用的领域: 取值为:iat、search、video、poi、music、asr;
iat:普通文本听写;
search:热词搜索;
video:视频音乐搜索;
asr:关键词识别;| + * | vad_bos | 前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms;
engine指定iat识别默认值为5000;
其他情况默认值为 4000,范围 0-10000。| + * | vad_eos | 后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入,自动停止录音;单位:ms;
sms 识别默认值为 1800;
其他默认值为 700,范围 0-10000。| + * | sample_rate | 采样率:目前支持的采样率设置有 16000 和 8000。| + * | asr_ptt | 标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。| + * | result_type | 返回结果的数据格式: 可设置为json,xml,plain,默认为json。| + * | grammarID | 识别的语法id: 只针对 domain 设置为”asr”的应用。| + * | asr_audio_path | 音频文件名: 设置此参数后,将会自动保存识别的录音文件。
路径为Documents/(指定值)。
不设置或者设置为nil,则不保存音频。| + * | params | 扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。| + * + * @param value 参数对应的取值 + * @param key 语义理解引擎参数 + * + * @return 成功返回YES;失败返回NO + */ +-(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; + +/*! + * 写入音频流 + * + * @param audioData 音频数据 + * + * @return 写入成功返回YES,写入失败返回NO + */ +- (BOOL) writeAudio:(NSData *) audioData; + +/*! + * 销毁语义理解对象。 + * + * @return 成功返回YES;失败返回NO + */ +- (BOOL) destroy; + +@end diff --git a/src/ios/iflyMSC.framework/Headers/IFlyTextUnderstander.h b/src/ios/iflyMSC.framework/Headers/IFlyTextUnderstander.h new file mode 100644 index 0000000..b411a23 --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyTextUnderstander.h @@ -0,0 +1,57 @@ +// +// TextUnderstand.h +// MSCDemo +// +// Created by iflytek on 4/24/14. +// Copyright (c) 2014 iflytek. All rights reserved. +// + +#import + +@class IFlySpeechError; + +/*! + * 文本转语义完成回调函数 + * + * @param result 成功,返回文本语义理解结果 + * @param error 错误描述 + */ +typedef void(^IFlyUnderstandTextCompletionHandler)(NSString* result, IFlySpeechError * error); + +/*! + * 文本转语义类 + */ +@interface IFlyTextUnderstander : NSObject + +/*! + * 是否正在文本转语义 + */ +@property (readonly, atomic) __block BOOL isUnderstanding; + +/*! + * 文本转语义接口
+ * 输入文本内容,获取语义理解结果 + * + * @param text 输入的文本内容 + * @param completionHandler 文本转语义完成回调函数 + * + * @return 错误码 + */ +-(int) understandText:(NSString*)text withCompletionHandler:(IFlyUnderstandTextCompletionHandler) completionHandler; + +/*! + * 设置文本转语义参数 + * + * @param value 参数对应的取值 + * @param key 文本转语义参数参数 + * + * @return 成功返回YES,失败返回NO + */ +-(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; + +/*! + * 取消本次会话 + */ +-(void)cancel; + +@end diff --git a/src/ios/iflyMSC.framework/Headers/IFlyVerifierUtil.h b/src/ios/iflyMSC.framework/Headers/IFlyVerifierUtil.h new file mode 100644 index 0000000..b9bda99 --- /dev/null +++ b/src/ios/iflyMSC.framework/Headers/IFlyVerifierUtil.h @@ -0,0 +1,39 @@ +// +// IFlyVerifierUtil.h +// IFlyMSC +// +// Created by 张剑 on 15/4/28. +// Copyright (c) 2015年 iflytek. All rights reserved. +// + +#import +#import + +/** + * 身份验证工具类 + */ +@interface IFlyVerifierUtil : NSObject + +#pragma mark - ISV + +/** + * 返回定长的随机数字字符串(不包含数字1,而且2和5不邻接) + * + * @param length 随机字符串长度 + * + * @return 随机字符串 + */ ++(NSString*)generateNumberPassword:(int)length; + + +#pragma mark - Face +/** + * ARGB彩图转灰度图,Detector和Alignment需要灰度图的输入 + * + * @param sourceImage ARGB彩图 + * + * @return 灰度图 + */ ++ (UIImage*)ARGBToGray:(UIImage*)sourceImage; + +@end diff --git a/src/ios/iflyMSC.framework/iflyMSC b/src/ios/iflyMSC.framework/iflyMSC index 57a81b9..0f416fc 100644 Binary files a/src/ios/iflyMSC.framework/iflyMSC and b/src/ios/iflyMSC.framework/iflyMSC differ