Octopus - iOS Quick Start
Platforms
- iOS (9.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.
Install CocoaPods
Import the Octopus-iOS pod by adding the following line to the project's
Podfile
:
pod 'Octopus-iOS'
- Run the following from the project directory:
pod install
Usage
Create an instance of Octopus
:
import Octopusdo {let octopus = try Octopus(accessKey: "${ACCESS_KEY}")} catch { }
Index an audio file by passing in the absolute path to the file:
do {let metadata = try octopus.indexAudioFile(path: "${AUDIO_FILE_PATH}")} catch { }
Search audio using the generated metadata object:
let phrases: Set<String> = ["gorilla", "terminator"]let matches = try octopus.search(metadata: metadata, phrases: phrases)
Free resources used by Octopus
:
metadata.delete();octopus.delete();
Demo
For the Octopus iOS SDK, we offer a demo application that demonstrates how to use the Speech-to-Index engine on audio recordings.
Setup
Clone the Octopus repository from GitHub using HTTPS:
git clone --recurse-submodules https://github.com/Picovoice/octopus.git
Usage
- Before building the demo app, run the following to install the Octopus CocoaPod:
cd octopus/demo/ios/pod install
Replace
"${YOUR_ACCESS_KEY_HERE}"
inside theViewModel.swift
file with your AccessKey obtained from Picovoice Console.Open
OctopusDemo.xcworkspace
and run the demo.
For more information on our Octopus demo for iOS, head over to our Github repository.