This sample demonstrates how to recognize speech with Objective-C using the Speech SDK for iOS. See the accompanying article on the SDK documentation page for step-by-step instructions.
- A subscription key for the Speech service. See Try the speech service for free.
- A Mac with XCode 9.4.1 installed as iOS development environment. This tutorial targets iOS versions 11.4.
By downloading the Microsoft Cognitive Services Speech SDK, you acknowledge its license, see Speech SDK license agreement.
The Cognitive Services Speech SDK for iOS can be downloaded as a zip-file from https://aka.ms/csspeech/iosbinary. Download and copy the files to the speechsdk
directory in the directory of this README.md
, i.e. parallel to the helloworld
directory that contains the XCode project.
Open the helloworld.xcodeproj
from the sample code.
This loads the project in XCode.
Next, add your subscription details to the helloworld/ViewController.m
file:
-
Replace the string
YourSubscriptionKey
with your subscription key. -
Replace the string
YourServiceRegion
with the region associated with your subscription (for example,westus
for the free trial subscription).
To build the sample app and check if all the paths are set correctly, choose Product > Build from the menu.
To run the sample, click the Play
button, or select Product > Run from the menu.
In the simulator window that opens, after you click the "Recognize!" button in the app, you should see the recognized text from the audio file "What's the weather like?" on the lower part of the simulated screen.