Orca Streaming Text-to-Speech
C Quick Start
Platforms
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Raspberry Pi (3, 4, 5)
Requirements
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey
.
Make sure to keep your AccessKey
secret.
Quick Start
Setup
- Clone the repository:
Usage
- Include
the public header files (
picovoice.h
andpv_orca.h
). - Link the project to an appropriate precompiled library for the target platform and load it.
- Choose a voice by selecting a model file located in the Orca Streaming Text-to-Speech GitHub repository.
- Construct the Orca object:
- Create a
synthesize_params
object to control the synthesized speech:
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, run the following after step 5.
- Create an
orca_stream
object usingsynthesize_params
:
- Add text chunks to
orca_stream
one-by-one and handle the synthesized audio:
- Once the text stream is complete, call the flush method to synthesize the remaining text:
- Once the PCM chunks are handled, make sure to release the acquired resources for each chunk with:
- Finally, when done make sure to close the stream:
Single synthesis
To synthesize a complete text in a single call to Orca
, run the following after step 5:
- Use the
Orca
object andsynthesize_params
to synthesize speech:
Release resources
Finally, when done with Orca Streaming Text-to-Speech, release resources explicitly:
Demo
For the Orca Streaming Text-to-Speech C SDK, we offer demo applications that demonstrate how to synthesize speech with Orca.
Setup
- Clone the Orca Streaming Text-to-Speech repository from GitHub using HTTPS:
Usage
Streaming synthesis demo
For the streaming synthesis demo, we simulate a response from a language model by creating a text stream from a user-defined text. After step 1. run the following:
- Build the demo:
- To see the usage options for the demo:
- Run the command corresponding to your platform from the root of the repository:
Single synthesis demo
To synthesize a complete text in a single call to Orca Streaming Text-to-Speech, run the following after step 1:
- Build the demo:
- Run the command corresponding to your platform from the root of the repository:
For more information on our Orca Streaming Text-to-Speech demos for C, head over to our GitHub repository.