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

  1. Install Xcode.

  2. Install CocoaPods

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

pod 'Octopus-iOS'
  1. Run the following from the project directory:
pod install

Usage

Create an instance of Octopus:

import Octopus
do {
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

  1. Before building the demo app, run the following to install the Octopus CocoaPod:
cd octopus/demo/ios/
pod install
  1. Replace "${YOUR_ACCESS_KEY_HERE}" inside the ViewModel.swift file with your AccessKey obtained from Picovoice Console.

  2. Open OctopusDemo.xcworkspace and run the demo.

For more information on our Octopus demo for iOS, head over to our Github repository.

Resources

Packages

API

GitHub

Benchmark


Issue with this doc? Please let us know.