Micro-letter can only develop platform http://pr.weixin.qq.com/, which contains micro-letter voice and image, integration is very simple, download side demo will have a document, according to the process (because it only provides the real machine. A file, so you can only use the real machine Oh, otherwise will be an error)
Use a UI-interface SDK First
1. Install the SDK, introduce the related package
2. Set Build Settings
C + + Standard library:libstdc++ or Compiler Default
Compile Sources as:objective-c++ or change the file name extension using the SDK to. mm
Change a file suffix to. mm, or you'll get an error.
3. Add code
#import "CustomNewViewControl.h"
#import "WXSpeechRecognizerWithUI.h"
@interface Customnewviewcontrol () <WXVoiceWithUIDelegate> {
Wxspeechrecognizerwithui *_wxssui;
__weak iboutlet Uilabel *label;
}
@property (Weak, nonatomic) Iboutlet UIButton *button;
@end
@implementation Customnewviewcontrol
-(void) viewdidload {
[super viewdidload];
_wxssui = [[Wxspeechrecognizerwithui alloc] initwithdelegate:self anduserkey:@ "BFCECACABCBEAECDCBCA"];
Click event
-(ibaction) buttonpressed: (UIButton *) Sender {
Label.text = @ "";
[_wxssui Showandstart];
}
Agent Wxvoicewithuidelegate
-(void) Voiceinputresultarray: (Nsarray *) array{
wxvoiceresult *result=[array Objectatindex:];
[Label SetText:result.text];
}
The SDK with no UI interface is pretty much the same.
Note: The following rules apply to the use of UI-free UIs
The micro-credit voice open Platform provides voice recognition services for your applications free of charge, and you can set the UI freely according to your own style, but the word "powered by micro-intelligence" or "voice technology provided by micro-intelligence" should be correctly and fully labeled in the window of speech capture and recognition. Refer to the following window:
Integration and above, no longer repeat
VIEWCONTROLLER.M//WEIXINYUYINWUUI/////Created by Apple on//. Copyright (c) year TQH.
All rights reserved. #import "ViewController.h" #import "WXVoiceSDK.h" @interface Viewcontroller () <WXVoiceDelegate> @property (
Weak, nonatomic) Iboutlet Uilabel *label;
@property (Weak, nonatomic) Iboutlet UIButton *button;
@end @implementation Viewcontroller-(void) viewdidload {[Super viewdidload];
SDK wxvoicesdk *speechrecognizer = [Wxvoicesdk sharedwxvoice];
Optional setting Speechrecognizer.siltime =. F;
Required setting speechrecognizer.delegate = self;
[SpeechRecognizer setuserkey:@ "BFCECACABCBEAECDCBCA"]; #pragma mark-----------wxvoicedelegate-------------(void) Voiceinputresultarray: (Nsarray *) array{//Once this method is recalled, Array must have a value, so the else case will not happen, but it will be more secure if (array && array.count>) {Wxvoiceresult *result=[array Objectati
Ndex:];
_label.text = Result.text;
}else{_label.text = @ ""; }-(void) Voiceinputmakeerror: (Nsinteger) errorcode{_label.Text = [NSString stringwithformat:@ "error:%ld", (long) errorcode]; }-(void) Voiceinputvolumn: (float) volumn{//[_speechrecognizerview setvolumn:volumn];}-(void) voiceinputwaitforresult{//[_speechrecognizerview Finishrecorder];}-(void) voiceinputdidcancel{//[_
Speechrecognizerview Didcancel];
#pragma mark-click Event-(ibaction) buttonpressed: (UIButton *) Sender {sender.selected =!sender.selected;
if (sender.selected) {_label.text = @ "Recording ...";
[[Wxvoicesdk Sharedwxvoice] startonce];
[_button settitle:@ "complete" forstate:uicontrolstatenormal];
}else {[[Wxvoicesdk Sharedwxvoice] finish];
[_button settitle:@ "Recording" Forstate:uicontrolstatenormal];
}-(Ibaction) cancelbuttonpressed: (UIButton *) sender {[[Wxvoicesdk sharedwxvoice] cancel];
[_button settitle:@ "Recording" Forstate:uicontrolstatenormal]; } @end
The above is this article on the development of iOS Third-party language-micro-letter language, all the introduction, I hope to help.