#when using the javascript sdk to start a voice conversation, the voice speed is randomly different

1 messages · Page 1 of 1 (latest)

long briarBOT
#
AI-generated Answer for lmelzer

Short answer: fix the transport and lock the voice settings.

What to do

  • Use WebRTC for browser conversations. Start the session with connectionType: 'webrtc'. In WebRTC mode the SDK hardcodes both input and output audio to PCM at 48 kHz, which prevents playback‑rate mismatches across Chrome/Firefox and yields consistent speed. (elevenlabs.io)
  • Explicitly set a fixed speaking speed in your agent’s Voice settings. The speed parameter is supported (range 0.7–1.2; default 1.0) and is available on the Agents Platform; keep it at 1.0 (or your chosen value) for consistency. (elevenlabs.io)
  • If you must use WebSocket instead of WebRTC, ensure the audio format/sample rate you receive matches what the browser expects. The Agent WebSockets API exposes the agent_output_audio_format (e.g., pcm_16000) in the initiation metadata; configure your agent to a 48 kHz format (e.g., Opus 48 kHz or PCM 48 kHz), which are supported, to avoid “chipmunk” playback. (elevenlabs.io)
  • For additional consistency, avoid very low Stability values. Lower stability increases randomness and can make speech sound “too quick”; higher stability yields more consistent pacing. (elevenlabs.io)

Minimal example (WebRTC)

  • const conversation = await Conversation.startSession({ agentId: '<agentId>', connectionType: 'webrtc' }); (elevenlabs.io)

These steps align with the SDK behavior (fixed 48 kHz in WebRTC) and documented voice controls, and are the recommended way to achieve stable, consistent voice speed in the browser. (elevenlabs.io)

Sources:
JavaScript SDK | ElevenLabs Documentation
Speed control | ElevenLabs Documentation
Agent WebSockets | ElevenLabs Documentation
Studio overview | ElevenLabs Documentation
JavaScript SDK | ElevenLabs Documentation
JavaScript SDK | ElevenLabs Documentation

stone solar
#

Transport is already set to webrtc and voice settings are also set explicitly. But still, voice is randomly high pitched