This is a basic demo to show how to use Orca for web browsers, using the IIFE version of the library (i.e. an HTML script tag). It instantiates an Orca worker engine and uses it to perform text-to-speech.
Orca requires a valid Picovoice AccessKey
at initialization. AccessKey
acts as your credentials when using Orca
SDKs.
You can get your AccessKey
for free. Make sure to keep your AccessKey
secret.
Signup or Login to Picovoice Console to get your AccessKey
.
Use yarn
or npm
to install the dependencies, and the start
script to start a local web server hosting the demo.
yarn
yarn start
(or)
npm install
npm run start
Open localhost:5000
in your web browser, as hinted at in the output:
Available on:
http://localhost:5000
Hit CTRL-C to stop the server
Copy in your AccessKey from Picovoice Console, and click "Start Orca".
Orca 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, the complete text needs to be known in advance and is synthesized in a single call to the Orca engine.
Click on either "Streaming Synthesis" or "Single Synthesis" to continue.
- Choose desired speech rate (or keep the default)
- Click "Open Stream"
- Type in any text (in English only).
- When you're done, click "Run Streaming Synthesis" to run streaming synthesis on a simulated text stream.
- Type in any text (in English only)
- Change the speech rate (or keep the default)
- Click "Synthesize"
- Click "Play" and listen for the generated speech.
Optional: If you wish, you may replace the model file in the index.html
with the male model file for a male
voice:
<script type="application/javascript" src="orca_params_en_male.js"></script>