Tag: 微软认知

将Microsoft Project Oxford语音识别从Objective-C转换为SWIFT

Microsoft Project Oxford在iOS上有一个很好的语音识别API和Objective-C指令。 按照入门指导,我可以轻松构build它。 但是,我很难将其转换为Swift语言。 我首先创build了一个快速项目。 我创build了桥头文件(ProjectName-Bridging-Header.h)并将以下代码插入到此文件中: #import "SpeechRecognitionService.h" 我想将Objective-C的头文件和实现文件转换成ViewController.swift。 ViewController.h的内容: #import <UIKit/UIKit.h> #import "SpeechRecognitionService.h" @interface ViewController : UIViewController<SpeechRecognitionProtocol> { NSMutableString* textOnScreen; DataRecognitionClient* dataClient; MicrophoneRecognitionClient* micClient; SpeechRecognitionMode recoMode; bool isMicrophoneReco; bool isIntent; int waitSeconds; } @property (nonatomic, strong) IBOutlet UIButton* startButton; /* In our UI, we have a text box to show the reco results.*/ […]