To install the KeenASR XCFamework in your Objective C project perform the following steps:
1. Download the Latest Version of the XCFramework
-
Download the trial XCFramework and ASR Bundle.
-
Unzip all the downloaded archives.
2. Add XCFramework to your Project
- Add the xcframework to your project:
- Drag and drop the KeenASR.xcframework file into your Xcode project navigator.
- Check “Copy items if needed” if you want Xcode to copy it into your project folder.
- Make sure your target is selected
- Embed the framework:
- Select your project in the navigator
- Select your app target
- Go to the “General” tab
- Scroll to “Frameworks, Libraries, and Embedded Content”
- If KeenASR.xcframework isn’t listed, click the “+” button and add it
If you encounter linking issues, verify that the framework appears in:
- Build Phases → Link Binary With Libraries
- Build Phases → Embed Frameworks
3. Add the ASR Bundle to your Project
-
In the project navigator, select the project or group within a project to which you want to add the ASR Bundle.
-
Choose File > Add Files to “YOUR_APP_NAME”.
-
Click Options in the lower left and make sure Create folder references is checked.
-
Select the ASR bundle directory (for example, keenA1-nnet3chain-en-us) and click Add.
4. Update Project Build Configuration Settings
-
Add the libc++.tbd library. Under Targets, choose your target, select the Build Phases tab, open Link Binary With Libraries, click the Plus Sign (+) and add the libc++.tbd library.
-
Under Targets, choose your target, select Build Settings tab, search for “c++”. Make sure that C++ Language Dialect is set to C++11, and the C++ Standard Library is set to libc++.
-
Add the Accelerate framework. Under Targets, choose your target, select the Build Phases tab, open the Link Binary With Libraries, click the Plus Sign (+) and add the Accelerate.framework.
5. Update the Privacy Settings for Microphone Access
As of iOS 10, Apple requires all apps that access the microphone to provide the user with a reason why your app needs to access the microphone. To support this requirement, a key must be placed in the Info.plist file. If this key is not specified the app will crash as soon as it tries to access the microphone (in this case, on initialization of the framework). Review these pages for more information.
To add the microphone access key:
-
Open the Info.plist file in your project.
-
Add the NSMicrophoneUsageDescription key.
-
Specify your description as the string value, for example, “The speech recognition feature in this app requires access to the microphone”.
