Picovoice Platform
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 Picovoice-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.plist
file to enable recording with an iOS device's microphone
Usage
Include a Porcupine keyword file (.ppn
) and
a Rhino context file (.rhn
) in the app as a bundled
resource (found by selecting in Build Phases > Copy Bundle Resources). Then, get its path from the app bundle:
Alternatively, if the model files are deployed to the device with a different method, the absolute paths to the files on device can be used.
Create an instance of PicovoiceManager
that detects the wake word and infers intents from spoken commands:
Start audio capture:
Stop audio capture and processing with:
Release resources explicitly when done with Picovoice:
Custom Wake Words & Contexts
Create custom models using the Picovoice Console. Download the custom Porcupine
keyword (.ppn
) and Rhino context (.rhn
) files and include them in the app as a bundled resource (found by selecting in
Build Phases > Copy Bundle Resources).
Non-English Languages
Use the corresponding model file (.pv
) to infer non-English wake words and contexts. The model files for all supported
languages are available on
the Porcupine GitHub repository
and Porcupine GitHub repository.
Pass in the model file using the porcupineModelPath
and rhinoModelPath
input arguments to change the language:
Alternatively, if the model files are deployed to the device with a different method, the absolute paths to the files on device can be used.
Demo
For the Picovoice iOS SDK, we offer demo applications that demonstrate how to use the end-to-end speech recognition platform on real-time audio streams (i.e. microphone input).
Setup
Clone the Repository
Usage
- Install dependencies:
Open the
PicovoiceForegroundAppDemo.xcworkspace
.Replace
"${YOUR_ACCESS_KEY_HERE}"
in the file ContentView.swift with a validAccessKey
.Go to
Product > Scheme
and select the scheme for the language you would like to demo (e.g.arDemo
-> Arabic Demo,deDemo
-> German Demo).Run the demo with a simulator or connected iOS device.
For more information on our Picovoice demos for iOS, head over to our GitHub repository.