Rhino Speech-to-Intent
iOS Quick Start
Platforms
- iOS (13.0+)
Requirements
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey.
Make sure to keep your AccessKey secret.
Quick Start
Setup
Install Xcode.
Import the Rhino-iOS package into your project.
To import the package using SPM, open up your project's Package Dependencies in XCode and add:
To import it into your iOS project using CocoaPods, add the following line to your Podfile:
Then, run the following from the project directory:
- Add the following to the app's
Info.plistfile to enable recording with an iOS device's microphone
Usage
Include the context file (either a pre-built context file (.rhn) from the
Rhino Speech-to-Intent GitHub Repository or a custom context created
with the Picovoice Console) in the app as a bundled resource (found by selecting in
Build Phases > Copy Bundle Resources). Then, get its path from the app bundle:
Create an instance of RhinoManager that infers custom commands:
The onInferenceCallback parameter is a function that will be invoked when Rhino Speech-to-Intent has returned an inference result:
Start audio capture:
Once an inference has been made, the inferenceCallback will be invoked and audio capture will stop automatically.
Release resources explicitly when done with Rhino Speech-to-Intent:
Custom Contexts
Create custom contexts with the Picovoice Console. Download the custom context
file (.rhn) and include it in the app as a bundled resource (found by selecting in Build Phases > Copy Bundle
Resources).
Alternatively, if the context file is deployed to the device with a different method, the absolute path to the file on device can be used.
Non-English Languages
Use the corresponding model file (.pv) to infer non-English commands. The model files for all supported languages are
available on the Rhino Speech-to-Intent GitHub repository.
Pass in the model file using the modelPath input argument to change the inference language:
Alternatively, if the model file is deployed to the device with a different method, the absolute path to the file on device can be used.
Demo
For the Rhino Speech-to-Intent iOS SDK, we offer demo applications that demonstrate how to use the Speech-to-Intent engine on real-time audio streams (i.e. microphone input).
Setup
Clone the Repository:
Usage
- Install dependencies:
Open the
RhinoDemo.xcworkspace.Replace
"${YOUR_ACCESS_KEY_HERE}"in the file ContentView.swift with a validAccessKey.Go to
Product > Schemeand select the scheme for the language you would like to demo (e.g.esDemo-> Spanish Demo,deDemo-> German Demo).Run the demo with a simulator or connected iOS device.
For more information on our Rhino Speech-to-Intent demos for iOS, head over to our GitHub repository.