Skip to content

Extended Usage Example

A full-featured example showing voice selection, playback controls, speech parameter tuning, and a live event log.

  • Voice browser with language filtering
  • speak / pause / resume / cancel controls
  • 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)
ParameterMinDefaultMaxDescription
rate0.11.02.0Speech speed
pitch0.11.02.0Voice pitch
volume0.01.01.0Audio volume
rv.speak('Hello!', 'UK English Female', {
rate: 1.2,
pitch: 1.0,
volume: 0.8,
});

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.