源码简介
轻笔记是一款为懒人设计的笔记本,你只需要通过语音输入,即可完成笔记的书写。同时支持发邮件,分享到朋友圈等附加功能。大部分情况下你无需动笔,只需要靠说,就可以轻松记笔记、发邮件,是提高效率的好工具。
源码片段
- - (void)setupSpeechRecognizer
- {
- NSString *appid = @"540e8023";
- NSString *initString = [NSString stringWithFormat:@"appid=%@",appid];
- [IFlySpeechUtility createUtility:initString];
- //初始化语音识别控件
- self.iflyRecognizerView = [[IFlyRecognizerView alloc]initWithCenter:self.view.center];
- self.iflyRecognizerView.delegate = self;
- [self.iflyRecognizerView setParameter: @"iat" forKey:[IFlySpeechConstant IFLY_DOMAIN]];
- //asr_audio_path保存录音文件名,默认目录是documents
- [self.iflyRecognizerView setParameter: @"asrview.pcm" forKey:[IFlySpeechConstant ASR_AUDIO_PATH]];
- //设置返回的数据格式为默认plain
- [self.iflyRecognizerView setParameter:@"plain" forKey:[IFlySpeechConstant RESULT_TYPE]];
- }
- // 开始接受语音
- - (void)startListenning
- {
- [self.iflyRecognizerView start];
- NSLog(@"start listenning...");
- }
源码链接:http://down.51cto.com/data/1968326