Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Rhino Speech-to-Intent
iOS Quick Start


Platforms

  • iOS (9.0+)

Requirements

  • Xcode
  • CocoaPods

Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start

Setup

  1. Install Xcode.

  2. Install CocoaPods

  3. Import the Rhino-iOS binding by adding the following line to the project's Podfile:

pod 'Rhino-iOS'
  1. Run the following from the project directory:
pod install
  1. Add the following to the app's Info.plist file to enable recording with your iOS device's microphone
<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>

Usage

Include the context file (either a pre-built context file (.rhn) from the Rhino 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:

let contextPath = Bundle.main.path(forResource: "${CONTEXT_FILE}", ofType: "rhn")

Create an instance of RhinoManager that infers custom commands:

import Rhino
do {
let rhinoManager = try RhinoManager(
accessKey: "${ACCESS_KEY}",
contextPath: contextPath,
onInferenceCallback: inferenceCallback)
} catch { }

The onInferenceCallback parameter is a function that will be invoked when Rhino has returned an inference result:

let inferenceCallback: ((Inference) -> Void) = { inference in
if inference.isUnderstood {
let intent:String = inference.intent
let slots:Dictionary<String,String> = inference.slots
// take action based on inferred intent and slot values
} else {
// handle unsupported commands
}
}
}

Start audio capture:

do {
try rhinoManager.process()
} catch { }

Once an inference has been made, the inferenceCallback will be invoked and audio capture will stop automatically.

Release resources explicitly when done with Rhino:

rhinoManager.delete()
To use your own audio processing pipeline, check out the Low-Level Rhino API.

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 GitHub repository.

Pass in the model file using the modelPath input argument to change the inference language:

let modelPath = Bundle.main.path(forResource: "${MODEL_FILE}", ofType: "pv")
do {
let rhinoManager = try RhinoManager(
accessKey: "${ACCESS_KEY}",
contextPath: contextPath,
modelPath: modelPath,
onInferenceCallback: inferenceCallback)
} catch { }

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 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:

git clone --recurse-submodules https://github.com/Picovoice/rhino.git

Usage

  1. Install dependencies:
cd rhino/demo/ios/
pod install
  1. Replace let ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}" in the file ContentView.swift with a valid AccessKey.

  2. Open the RhinoDemo.xcworkspace and run the demo.

For more information on our Rhino demos for iOS, head over to our Github repository.

Resources

Package

  • Rhino-iOS on Cocoapods

API

  • Rhino-iOS API Docs

GitHub

  • Rhino iOS SDK on GitHub
  • Rhino iOS Demos on GitHub

Benchmark

  • Speech-to-Intent Benchmark

Further Reading

  • Siri Gets a Barista Job: Adding Offline Voice AI to a SwiftUI App

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Rhino Speech-to-Intent iOS Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Custom Contexts
  • Non-English Languages
  • Demo
  • Setup
  • Usage
  • Resources
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.