forked from liaojinxing/Voice2Note
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc3d74a
commit 0cccb90
Showing
22 changed files
with
1,168 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Contact.h | ||
// msc | ||
|
||
// description: 此接口为获取通信录中的联系人,获取联系人是为了在进行 | ||
// 语音识别时(sms)能更好的识别出您说的人名,联系人上传是属于个性化的一部分 | ||
|
||
// Created by ypzhao on 13-3-1. | ||
// Copyright (c) 2013年 IFLYTEK. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
/**此接口为获取通信录中的联系人 | ||
获取联系人是为了在进行 语音识别时(sms)能更好的识别出您说的人名,联系人上传是属于个性化的一部分 | ||
*/ | ||
@interface IFlyContact : NSObject | ||
|
||
/** 获取联系人 | ||
调用此方法需要添加 AddressBook.framework 到工程中,调用此方法后可以直接将通信录中的联系人转化为语音云识别的数据结构。您可以将获取的数据通过IFlyDataUploader类,上传到语音云,我们只获取通信录中的人名 | ||
@return 返回联系人信息 | ||
*/ | ||
- (NSString *) contact; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// DataDownloader.h | ||
// msc | ||
// | ||
// Created by ypzhao on 13-3-3. | ||
// Copyright (c) 2013年 IFLYTEK. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "IFlySpeechError.h" | ||
|
||
/**此接口为数据上传接口 | ||
为个性化服务提供数据 | ||
*/ | ||
@interface IFlyDataDownloader : NSObject | ||
|
||
/** 设置下载数据参数 | ||
@param parameter 参数值 | ||
@param key 参数名 | ||
*/ | ||
-(void) setParameter:(NSString*) parameter forKey:(NSString*) key; | ||
|
||
typedef void(^IFlyDownLoadDataCompletionHandler)(NSString* result,IFlySpeechError * error); | ||
/** 下载数据 | ||
下载过程是**异步**的 | ||
@param completionHandler 下载完成回调 | ||
*/ | ||
- (void) downLoadDataWithCompletionHandler:(IFlyDownLoadDataCompletionHandler) completionHandler; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// IFlyDataUploader.h | ||
// MSC | ||
|
||
// descrption: 数据上传类 | ||
|
||
// Created by ypzhao on 13-4-8. | ||
// Copyright (c) 2013年 iflytek. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "IFlySpeechError.h" | ||
|
||
@class IFlyDataUploader; | ||
|
||
/** 数据上传类 */ | ||
@interface IFlyDataUploader : NSObject | ||
{ | ||
int _error ; | ||
NSOperationQueue *_operationQueue; | ||
} | ||
|
||
@property(nonatomic,copy) NSString *dataName; | ||
@property(nonatomic,copy) NSString *data; | ||
|
||
typedef void(^IFlyUploadDataCompletionHandler)(NSString* result,IFlySpeechError * error); | ||
/** 上传数据 | ||
此函数用于上传数据,下载的过程是**异步**的。 | ||
@param completionHandler -[in] 上传完成回调 | ||
@param name -[in] 上传的内容名称,名称最好和你要上传的数据内容相关,不可以为nil | ||
@param data -[in] 上传的数据,以utf8编码,不可以为nil | ||
*/ | ||
- (void) uploadDataWithCompletionHandler:(IFlyUploadDataCompletionHandler)completionHandler name:(NSString *)name data:(NSString *)data; | ||
|
||
/** 设置上传数据参数 | ||
@param parameter 参数值 | ||
@param key 参数名 | ||
*/ | ||
-(void) setParameter:(NSString*) parameter forKey:(NSString*) key; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// | ||
// IFlyRecognizerView.h | ||
// MSC | ||
// | ||
// Created by admin on 13-4-16. | ||
// Copyright (c) 2013年 iflytek. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "IFlyRecognizerViewDelegate.h" | ||
|
||
/** 语音识别控件 | ||
录音时触摸控件结束录音,开始识别(相当于旧版的停止);触摸其他位置,取消录音,结束会话(取消) | ||
出错时触摸控件,重新开启会话(相当于旧版的再说一次);触摸其他位置,取消录音,结束会话(取消) | ||
*/ | ||
@interface IFlyRecognizerView : UIView<NSObject> | ||
|
||
/** 设置委托对象 */ | ||
@property(nonatomic,assign)id<IFlyRecognizerViewDelegate> delegate; | ||
|
||
/** 初始化控件 | ||
@param origin 控件左上角的坐标 | ||
@param initParam 初始化的参数,详见IFlySpeechRecognizer类初始化参数。 | ||
@return IFlyRecognizerView 对象 | ||
*/ | ||
- (id)initWithOrigin:(CGPoint)origin; | ||
|
||
/** 初始化控件 | ||
@param center 控件中心的坐标 | ||
@return IFlyRecognizerView 对象 | ||
*/ | ||
- (id) initWithCenter:(CGPoint)center; | ||
|
||
|
||
/** 设置横竖屏自适应 | ||
@param autoRotate 默认值YES,横竖屏自适应 | ||
*/ | ||
- (void) setAutoRotate:(BOOL)autoRotate; | ||
|
||
/** 设置识别引擎的参数 | ||
识别的引擎参数(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 |params:扩展参数,对于一些特殊的参数可在此设置,一般用于设置语义。 | ||
@param key 识别引擎参数 | ||
@param value 参数对应的取值 | ||
@return 设置的参数和取值正确返回YES,失败返回NO | ||
*/ | ||
-(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; | ||
|
||
/** 开始识别 | ||
@return 成功返回YES;失败返回NO | ||
*/ | ||
- (BOOL)start; | ||
|
||
/** 取消本次识别 */ | ||
- (void)cancel; | ||
|
||
|
||
@end |
32 changes: 32 additions & 0 deletions
32
Framework/iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// IFlyRecognizerDelegate.h | ||
// MSC | ||
// | ||
// Created by admin on 13-4-16. | ||
// Copyright (c) 2013年 iflytek. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "IFlySpeechError.h" | ||
|
||
@class IFlyRecognizerView; | ||
|
||
/** 识别回调委托 | ||
*/ | ||
@protocol IFlyRecognizerViewDelegate <NSObject> | ||
|
||
/** 回调返回识别结果 | ||
@param resultArray 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,value为置信度 | ||
@param isLast -[out] 是否最后一个结果 | ||
*/ | ||
- (void)onResult:(NSArray *)resultArray isLast:(BOOL) isLast; | ||
|
||
/** 识别结束回调 | ||
@param error 识别结束错误码 | ||
*/ | ||
- (void)onError: (IFlySpeechError *) error; | ||
|
||
@optional | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// IFlySetting.h | ||
// MSC | ||
// | ||
// Created by iflytek on 13-4-12. | ||
// Copyright (c) 2013年 iflytek. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
typedef enum _LOG_LEVEL { // 日志打印等级 | ||
LVL_ALL = -1, // 全部打印 | ||
LVL_DETAIL = 31, // 高,异常分析需要的级别 | ||
LVL_NORMAL = 15, // 中,打印基本日志信息 | ||
LVL_LOW = 7, // 低,只打印主要日志信息 | ||
LVL_NONE = 0 // 不打印 | ||
}LOG_LEVEL; | ||
|
||
/** | ||
此接口为iflyMSC sdk 配置接口。 | ||
可以获取版本号,设置日志打印等级等 | ||
*/ | ||
@interface IFlySetting : NSObject | ||
|
||
/** 获取版本号 | ||
@return 版本号 | ||
*/ | ||
+ (NSString *) getVersion; | ||
|
||
/** 获取日志等级 | ||
@return 返回日志等级 | ||
*/ | ||
+ (LOG_LEVEL) logLvl; | ||
|
||
|
||
/** 是否打印控制台log | ||
在软件发布时,建议关闭此log。 | ||
@param showLog -[in] YES,打印log;NO,不打印 | ||
*/ | ||
+ (void) showLogcat:(BOOL) showLog; | ||
|
||
/** | ||
设置日志msc.log生成路径以及日志等级<br> | ||
@param level -[in] 日志打印等级 | ||
<table> | ||
<thead> | ||
<tr><th>*日志打印等级</th><th><em>描述</em></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>LVL_ALL</td><td>全部打印</td></tr> | ||
<tr><td>LVL_DETAIL</td><td>高,异常分析需要的级别</td></tr> | ||
<tr><td>LVL_NORMAL</td><td>中,打印基本日志信息</td></tr> | ||
<tr><td>LVL_LOW</td><td>低,只打印主要日志信息</td></tr> | ||
<tr><td>LVL_NONE</td><td>不打印</td></tr> | ||
</tbody> | ||
</table> | ||
*/ | ||
+ (void) setLogFile:(LOG_LEVEL) level; | ||
|
||
@end |
Oops, something went wrong.