Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Orca Streaming Text-to-Speech
iOS Quick Start

Platforms

  • iOS (13.0+)

Requirements

  • Xcode
  • Swift Package Manager or 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. Import the Orca-iOS package into your project.

To import the package using SPM, open up your project's Package Dependencies in XCode and add:

https://github.com/Picovoice/orca.git

To import it into your iOS project using CocoaPods, add the following line to your Podfile:

pod 'Orca-iOS'

Then, run the following from the project directory:

pod install

Model File

Orca Streaming Text-to-Speech can synthesize speech in different languages and with a variety of voices, each of which is characterized by a model file (.pv) located in the Orca GitHub repository. The language and gender of the speaker is indicated in the file name.

To add an Orca Streaming Text-to-Speech model file to your iOS application:

  1. Download an Orca Streaming Text-to-Speech model file from the Orca GitHub Repository.
  2. Add the model as a bundled resource by selecting Build Phases and adding it to Copy Bundle Resources step.

Usage

Create an instance of the Orca Streaming Text-to-Speech engine:

import orca
let accessKey = "${ACCESS_KEY}"
let modelPath = Bundle(for: type(of: self)).path(
forResource: "${ORCA_MODEL_FILE}",
ofType: "pv")!
do {
let orca = try Orca(accessKey: accessKey, modelPath: modelPath)
} catch { }

Alternatively, you can provide modelPath as an absolute path to the model file on device.

Orca Streaming Text-to-Speech supports two modes of operation: streaming and single synthesis. In the streaming synthesis mode, Orca processes an incoming text stream in real-time and generates audio in parallel. In the single synthesis mode, a complete text is synthesized in a single call to the Orca engine.

Streaming synthesis

To synthesize a text stream, create an Orca.OrcaStream object and add text to it one-by-one:

do {
let orcaStream = try orca.streamOpen()
for textChunk in textGenerator() {
let pcm = orcaStream.synthesize(textChunk)
if pcm != nil {
// handle pcm
}
}
} catch { }

The textGenerator() function can be any stream generating text, such as an LLM response.

The Orca.OrcaStream object buffers input text until there is enough context to generate audio. If there is not enough text to generate audio, nil is returned.

Once the text stream is complete, call the flush method to synthesize the remaining text:

do {
let pcm = orcaStream.flush()
if pcm != nil {
// handle pcm
}
} catch { }

When done with streaming text synthesis, the Orca.OrcaStream object needs to be closed:

orcaStream.close()

Single synthesis

If the complete text is known before synthesis, single synthesis mode can be used to generate speech in a single call to Orca Streaming Text-to-Speech:

do {
// Return raw PCM and alignments
let (pcm, wordArray) = try orca.synthesize(text: "${TEXT}")
} catch { }
do {
// Save the generated audio to a WAV file directly
let wordArray = try orca.synthesizeToFile(text: "${TEXT}", outputPath: "${OUTPUT_PATH}")
} catch { }

Replace ${TEXT} with the text to be synthesized and ${OUTPUT_PATH} with the path to save the generated audio as a single-channel 16-bit PCM WAV file.

In single synthesis mode, Orca Streaming Text-to-Speech returns metadata of the synthesized audio in the form of an array of OrcaWord objects.

The OrcaWord object has the following properties:

  • Word: String representation of the word.
  • Start Time: Indicates when the word started in the synthesized audio. Value is in seconds.
  • End Time: Indicates when the word ended in the synthesized audio. Value is in seconds.
  • Phonemes: An array of OrcaPhoneme objects.

The OrcaPhoneme object has the following properties:

  • Phoneme: String representation of the phoneme.
  • Start Time: Indicates when the phoneme started in the synthesized audio. Value is in seconds.
  • End Time: Indicates when the phoneme ended in the synthesized audio. Value is in seconds.

When done make sure to explicitly release the resources using:

orca.delete()

For more information on our Orca Streaming Text-to-Speech iOS SDK, head over to our Orca GitHub repository.

Demos

For the Orca Streaming Text-to-Speech iOS SDK, we offer a demo application that demonstrates how to use the Text-to-Speech engine.

Setup

Clone the Repository

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

Usage

  1. Replace "${YOUR_ACCESS_KEY_HERE}" in the ViewModel.swift file with a valid AccessKey.

  2. Open OrcaDemo.xcodeproj in XCode and run the demo.

For more information on our Orca Streaming Text-to-Speech demo for iOS, head over to our GitHub repository.

Resources

Package

  • Orca-iOS on Cocoapods

API

  • Orca-iOS API Docs

GitHub

  • Orca Streaming Text-to-Speech iOS SDK on GitHub
  • Orca Streaming Text-to-Speech iOS demo on GitHub

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Orca Streaming Text-to-Speech iOS Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Model File
  • Usage
  • Demos
  • Setup
  • Usage
  • Resources
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.