Extended Usage Example
A full-featured example showing voice selection, playback controls, speech parameter tuning, and a live event log.
What it covers
Section titled “What it covers”- Voice browser with language filtering
speak/pause/resume/cancelcontrols- Rate / pitch / volume sliders
- Platform detection (browser, OS, device type)
- Real-time event log
- Demo mode indicator driven by
rv.isDemoMode() - Force-fallback toggle (use HTTP audio instead of Web Speech API)
Speech parameter ranges
Section titled “Speech parameter ranges”| Parameter | Min | Default | Max | Description |
|---|---|---|---|---|
rate | 0.1 | 1.0 | 2.0 | Speech speed |
pitch | 0.1 | 1.0 | 2.0 | Voice pitch |
volume | 0.0 | 1.0 | 1.0 | Audio volume |
rv.speak('Hello!', 'UK English Female', { rate: 1.2, pitch: 1.0, volume: 0.8,});Force fallback mode
Section titled “Force fallback mode”Bypass the Web Speech API and always use HTTP audio from the server:
await rv.init({ apiKey: 'your-api-key', forceFallback: true });Useful when you need consistent audio across browsers, or when Web Speech API voices are unavailable on the target device.
Next Steps
Section titled “Next Steps”- Basic Example — the minimal starting point
- Voice Selection Guide — advanced voice filtering
- Events Guide — full event reference