該源碼是語音分享應用源碼,本demo使用了科大訊飛語音識別做爲分享內容的輸入方式,同時也支持手動鍵盤輸入分享內容,限制分享內容文字不能超過180個字符,分享內容輸入完成後能夠直接分享,分享SDK使用的時友盟社會化分享。html
- (IBAction)voiceRecognize:(id)sender { [self.textView resignFirstResponder]; _result = @""; [_iflyRecognizerView start]; } - (void)onResult:(NSArray *)resultArray isLast:(BOOL)isLast { NSDictionary *dic = [resultArray objectAtIndex:0]; NSMutableString *result = [NSMutableString new]; NSLog(@"DIC:%@",dic); for (NSString *key in dic) { [result appendFormat:@"%@",key]; } NSLog(@"result:%@",result); _result = [NSString stringWithFormat:@"%@%@",_result,result]; if (isLast) { if (_result == nil||[_result isEqualToString:@""]) { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"沒法識別,請再說一遍" message:nil delegate:nil cancelButtonTitle:@"肯定" otherButtonTitles:nil]; [alert show]; }else{ self.textView.text = _result; } } }
<ignore_js_op>ios
運行截圖app
<ignore_js_op>spa
運行截圖code
<ignore_js_op>orm
運行截圖htm
<ignore_js_op>get
源碼下載:http://code.662p.com/view/9125.html源碼
詳細說明:http://ios.662p.com/thread-2164-1-1.htmlstring
運行截圖