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
Web API

API Reference for the Orca Web SDK (orca-web)


Orca

class Orca {}

Class for the Orca Streaming Text-to-Speech engine.


Orca.create()

static async function create(
accessKey: string,
model: OrcaModel
): Promise<Orca>

Creates an instance of Orca Streaming Text-to-Speech engine using '.pv' file in public directory. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model OrcaModel : Orca model options.

Returns

  • Orca : An instance of the Orca engine.

Orca.synthesize()

async function synthesize(text: string, synthesizeParams?: OrcaSynthesizeParams): Promise<OrcaSynthesizeResult>

Generates audio from text. The returned result contains the speech representation of the text.

Parameters

  • text string : Text to be converted to audio. The maximum number of characters per call is .maxCharacterLimit. The complete list of allowed characters can be retrieved with .validCharacters. Custom pronunciations can be embedded in the text via the syntax "{word|pronunciation}". The pronunciation is expressed in ARPAbet phonemes, for example: "{read|R IY D} this as {read|R EH D}".
  • synthesizeParams OrcaSynthesizeParams : Optional configuration arguments.

Returns

  • OrcaSynthesizeResult : An Orca synthesize result object.

Orca.release()

async function release(): Promise<void>

Releases resources acquired by the Orca Web SDK.


Orca.sampleRate

get sampleRate(): number

Audio sample rate of the synthesized speech.


Orca.maxCharacterLimit

get maxCharacterLimit(): number

Maximum number of characters accepted by Orca in one .synthesize() call.


Orca.validCharacters

get validCharacters(): string[]

Valid characters accepted by Orca.


Orca.version

get version(): string

Orca version string.


Orca.streamOpen()

async function streamOpen(synthesizeParams?: OrcaSynthesizeParams): Promise<OrcaStream>

Opens a stream for streaming text synthesis.

Parameters

  • synthesizeParams OrcaSynthesizeParams : Optional configuration arguments.

Returns

  • OrcaStream : An OrcaStream object.

OrcaStream

class OrcaStream {}

Class for handling input text streaming synthesis.


OrcaStream.synthesize()

async function synthesize(text: string): Promise<OrcaStreamSynthesizeResult>

Adds a chunk of text to the OrcaStream object and generates audio if enough text has been added. This function is expected to be called multiple times with consecutive chunks of text from a text stream. The incoming text is buffered as it arrives until there is enough context to convert a chunk of the buffered text into audio. The caller needs to use the OrcaStream.flush() method to generate the audio chunk for the remaining text that has not yet been synthesized.

Parameters

  • text string : Text to be converted to audio. For details see Orca.synthesize().

Returns

  • OrcaStreamSynthesizeResult : OrcaStream synthesize result.

OrcaStream.flush()

async function flush(): Promise<OrcaStreamSynthesizeResult>

Generates audio for all the buffered text that was added to the OrcaStream object via OrcaStream.synthesize(). This function should be called when there is no more text to be added to the stream.

Returns

  • OrcaStreamSynthesizeResult : OrcaStream synthesize result.

OrcaStream.close()

async function close(): Promise<void>

Closes the OrcaStream object and releases resources acquired by the Orca Web SDK.


OrcaModel

type OrcaModel = {
base64?: string;
publicPath?: string;
customWritePath?: string;
forceWrite?: boolean;
version?: number;
}

Orca model type.

  • base64 string: The model file (.pv) in base64 string to initialize Orca.
  • publicPath string: The model file (.pv) path relative to the public directory.
  • customWritePath string : Custom path to save the model in storage. Set to a different name to use multiple models across orca instances.
  • forceWrite boolean : Flag to overwrite the model in storage even if it exists.
  • version number : Version of the model file. Increment to update the model file in storage.

OrcaSynthesizeParams

type OrcaSynthesizeParams = {
speechRate?: number;
randomState?: number | null;
}

Orca Synthesize params type.

  • speechRate number : Optional configuration to control the speed of the generated speech. Valid values are within [0.7, 1.3]. A higher value produces speech that is faster, and a lower value produces speech that is slower. The default is 1.0.
  • randomState number : Optional configuration to set the random state for sampling during synthesis. This can be used to ensure that the synthesized speech is deterministic across different runs. Valid values are all non-negative integers. If not provided, a random seed will be chosen and the synthesis process will be non-deterministic.

OrcaSynthesizeResult

type OrcaSynthesizeResult = {
pcm: Int16Array;
alignments: OrcaAlignment[];
}

Orca synthesize result type.

  • pcm Int16Array : The output audio, represented as a 16-bit linearly-encoded integer array.
  • alignments OrcaAlignment[] : Orca alignments.

OrcaAlignment

type OrcaAlignment = {
word: string;
startSec: number;
endSec: number;
phonemes: OrcaPhoneme[];
}

Orca word alignment type.

  • word string : Synthesized word.
  • startSec number : Start time of the word in seconds.
  • endSec number : End time of the word in seconds.
  • phonemes OrcaPhoneme[] : Orca phonemes.

OrcaPhoneme

type OrcaPhoneme = {
phoneme: string;
startSec: number;
endSec: number;
}

Orca phoneme alignment type.

  • word string : Synthesized phoneme.
  • startSec number : Start time of the phoneme in seconds.
  • endSec number : End time of the phoneme in seconds.

OrcaStreamSynthesizeResult

type OrcaStreamSynthesizeResult = Int16Array | null

OrcaStream synthesize result type. This value will be either the generated audio as a sequence of 16-bit linearly-encoded integers, or null if no audio chunk has been produced.


OrcaWorker

class OrcaWorker {}

A class for creating new instances of the OrcaWorker.


OrcaWorker.create()

static async create(
accessKey: string,
model: OrcaModel
): Promise<OrcaWorker>

Creates an instance of OrcaWorker using '.pv' file in public directory. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • model OrcaModel : Orca model options.

Returns

  • OrcaWorker : An instance of OrcaWorker.

OrcaWorker.synthesize()

async function synthesize(text: string, synthesizeParams?: SynthesizeParams): Promise<OrcaSynthesizeResult>

Generates audio from text. The returned result contains the speech representation of the text.

Parameters

  • text string : Text to be converted to audio. For details see Orca.synthesize().
  • synthesizeParams OrcaSynthesizeParams : Optional configuration arguments.

Returns

  • OrcaSynthesizeResult : An Orca synthesize result object.

OrcaWorker.release()

async function release(): Promise<void>

Releases resources acquired by the Orca Web SDK.


OrcaWorker.terminate()

async function terminate(): Promise<void>

Force terminates the instance of OrcaWorker.


OrcaWorker.sampleRate

get sampleRate(): number

Audio sample rate of the synthesized speech.


OrcaWorker.maxCharacterLimit

get maxCharacterLimit(): number

Maximum number of characters accepted by Orca in one .synthesize() call.


OrcaWorker.validCharacters

get validCharacters(): string[]

Valid characters accepted by Orca.


OrcaWorker.version

get version(): string

Orca version string.


OrcaWorker.streamOpen()

async function streamOpen(synthesizeParams?: OrcaSynthesizeParams): Promise<OrcaStreamWorker>

Opens a stream for streaming text synthesis.

Parameters

  • synthesizeParams OrcaSynthesizeParams : Optional configuration arguments.

Returns

  • OrcaStreamWorker : An instance of OrcaStreamWorker.

OrcaStreamWorker

class OrcaStreamWorker {}

A class for creating new instances of the OrcaStreamWorker.


OrcaStreamWorker.synthesize()

async function synthesize(text: string): Promise<OrcaStreamSynthesizeResult>

See OrcaStream.synthesize() for details.

Parameters

  • text string : Text to be converted to audio. For details see Orca.synthesize().

Returns

  • OrcaStreamSynthesizeResult : OrcaStream synthesize result.

OrcaStreamWorker.flush()

async function flush(): Promise<OrcaStreamSynthesizeResult>

See OrcaStream.flush() for details.

Returns

  • OrcaStreamSynthesizeResult : OrcaStream synthesize result.

OrcaStreamWorker.close()

async function close(): Promise<void>

See OrcaStream.close() for details.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Orca Streaming Text-to-Speech Web API
  • Orca
  • create()
  • synthesize()
  • release()
  • sampleRate
  • maxCharacterLimit
  • validCharacters
  • version
  • streamOpen()
  • OrcaStream
  • synthesize()
  • flush()
  • close()
  • OrcaModel
  • OrcaSynthesizeParams
  • OrcaSynthesizeResult
  • OrcaAlignment
  • OrcaPhoneme
  • OrcaStreamSynthesizeResult
  • OrcaWorker
  • create()
  • synthesize()
  • release()
  • terminate()
  • sampleRate
  • maxCharacterLimit
  • validCharacters
  • version
  • streamOpen()
  • OrcaStreamWorker
  • synthesize()
  • flush()
  • close()
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.