Skip to content

Integrate ElevenLabs voices into SpeechProvider architecture #1992

@martinbedouret

Description

@martinbedouret

Extend the existing SpeechProvider to include ElevenLabs cloned voices alongside local and Azure cloud voices, following established patterns.

Acceptance Criteria

  • Add ElevenLabs voice source type (voiceSource: 'elevenlabs') to voice objects
  • Extend getVoices() action in SpeechProvider.actions.js to fetch ElevenLabs voices
  • Modify voice filtering and selection logic to handle ElevenLabs voices
  • Add ElevenLabs-specific voice metadata (voice_id, category, settings)
  • Implement voice caching with refresh mechanisms
  • Add fallback handling when ElevenLabs API is unavailable
  • Update voice object structure to support ElevenLabs properties

Technical Implementation Notes

// Extend voice object structure
const elevenLabsVoice = {
  voiceURI: voice.voice_id,
  name: voice.name,
  lang: voice.labels?.language || "en-US",
  voiceSource: "elevenlabs",
  voice_id: voice.voice_id,
  category: voice.category,
  description: voice.description,
  settings: {
    stability: 0.5,
    similarity_boost: 0.8,
    style: 0.0,
  },
};

// Update getVoices() in SpeechProvider.actions.js
const elevenLabsVoices = await API.getElevenLabsVoices();
const formattedElevenLabsVoices = elevenLabsVoices.map((voice) => ({
  ...voice,
  voiceSource: "elevenlabs",
  voiceURI: voice.voice_id,
}));

Files to Modify

  • src/providers/SpeechProvider/SpeechProvider.actions.js
  • src/providers/SpeechProvider/SpeechProvider.reducer.js
  • src/providers/SpeechProvider/SpeechProvider.constants.js

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions