Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repo contains iOS samples for using Speech-to-Text in the Microsoft Bing Sp
## The Client Library
The client library is a client library for Speech-to-Text in the Microsoft Bing Speech API

To add the client library dependency from an existing XCode Project:
To add the client library dependency from an existing Xcode Project:
1. Select your target application, and open the menu `File` then `Add Files to ...`

2. Navigate to `Speech > SpeechToText > iOS > iPhoneOS`, select `SpeechSDK.framework`, and click `Add`.
Expand All @@ -27,16 +27,32 @@ This sample demonstrates the following features using a wav file or external mic


### Build the sample
1. First, you must obtain a Speech API subscription key by [following the instructions on our website(<https://www.microsoft.com/cognitive-services/en-us/sign-up>).
1. First, you must obtain a Speech API subscription key by [following the instructions on our website (<https://www.microsoft.com/cognitive-services/en-us/sign-up>).

2. Start XCode and choose the menu `File`, and `Open...` the workspace file `Speech > SpeechToText > iOS > SpeechSDK.xcworkspace`.
- Get the “Key 1” entry for “Bing Speech” from the [Subscriptions](https://www.microsoft.com/cognitive-services/en-US/subscriptions). This will be your `primaryKey`.

3. In XCode, select menu `Product > Build` to build the sample,
- Additionally, sign into [Language Understanding Intelligent Service (LUIS)](https://www.luis.ai) using the account you just created.

- Create a new LUIS app
- Suggested name: SpeechRecognitionServerExample

- Get the `App Id` from “App Settings”. This will be your `luisAppID` below.

- Get your LUIS subscription ID. This is the “Programmatic API Key” listed in your account’s “Settings” when you are logged in to LUIS.

2. Start Xcode and choose the menu `File`, and `Open...` the workspace file `Speech > SpeechToText > iOS > SpeechSDK.xcworkspace`.

- Edit the “settings.plist” in Xcode with the information obtained above.

- You can prevent this from causing your git repo to be dirty by [locally setting changes to be ignored](http://stackoverflow.com/a/4633776) from within the repo’s root:
> git update-index --assume-unchanged "Samples/SpeechRecognitionServerExample/settings.plist"

3. In Xcode, select menu `Product > Build` to build the sample,
and `Run` to launch this sample app.


### Running the sample
In XCode, select the menu `Product`, and `Run` to launch this sample app.
In Xcode, select the menu `Product`, and `Run` to launch this sample app.

1. In the application, press the button `Change Mode` to select what type of Speech would like to use.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
744057E51AB005E900D4462E /* Products */,
);
sourceTree = "<group>";
usesTabs = 0;
};
744057E51AB005E900D4462E /* Products */ = {
isa = PBXGroup;
Expand Down Expand Up @@ -312,9 +313,7 @@
CLANG_ENABLE_MODULES = YES;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "../../$PLATFORM_NAME/**";
HEADER_SEARCH_PATHS = (
"$(inherited)",
);
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = SpeechRecognitionServerExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
Expand All @@ -331,9 +330,7 @@
CLANG_ENABLE_MODULES = YES;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "../../$PLATFORM_NAME/**";
HEADER_SEARCH_PATHS = (
"$(inherited)",
);
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = SpeechRecognitionServerExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ -(void)viewDidLoad {
dataLongRadioButton,
dataShortIntentRadioButton,
nil];
[self showMenu:TRUE];
[self showMenu:YES];
textOnScreen = [NSMutableString stringWithCapacity: 1000];
}

Expand All @@ -204,7 +204,7 @@ -(IBAction)StartButton_Click:(id)sender {
[self setText: textOnScreen];
[[self startButton] setEnabled:NO];

[self showMenu:FALSE];
[self showMenu:NO];

[self logRecognitionStart];

Expand Down Expand Up @@ -437,7 +437,7 @@ -(IBAction)RadioButton_Click:(id)sender {
NSUInteger index = [self.buttonGroup indexOfObject:sender];
for(NSUInteger i = 0; i < self.buttonGroup.count; ++i) {
UNIVERSAL_BUTTON* buttonSel = (UNIVERSAL_BUTTON*)self.buttonGroup[i];
UNIVERSAL_BUTTON_SETCHECKED(buttonSel, (index == i) ? TRUE : FALSE);
UNIVERSAL_BUTTON_SETCHECKED(buttonSel, (index == i) ? YES : NO);
}

if (micClient != nil) {
Expand All @@ -450,7 +450,7 @@ -(IBAction)RadioButton_Click:(id)sender {
dataClient = nil;
}

[self showMenu:FALSE];
[self showMenu:NO];
}

/**
Expand Down Expand Up @@ -508,7 +508,7 @@ -(IBAction)RadioButton_Click:(id)sender {
* @param sender The sending caller.
*/
-(IBAction)ChangeModeButton_Click:(id)sender {
[self showMenu:TRUE];
[self showMenu:YES];
}

/**
Expand Down