Repository navigation
feat: add VoiceStudio as local ElevenLabs-compatible TTS provider - #982
Open
subrotosanyal wants to merge 5 commits into
Open
subrotosanyal wants to merge 5 commits into
subrotosanyal wants to merge 5 commits into
Conversation
Adds tools/audio/voicestudio_tts.py — a BaseTool subclass that integrates VoiceStudio (https://github.com/debpalash/VoiceStudio) as a fully-local, ElevenLabs-compatible TTS provider. - capability = "tts" so tts_selector.py auto-discovers it - get_status() probes VoiceStudio's health endpoint; only activates when VoiceStudio is running (safe on machines without it) - Hits http://127.0.0.1:3900/elevenlabs/v1/text-to-speech/{voice_id} - VOICESTUDIO_URL env var overrides base URL for remote instances - OMNIVOICE_API_KEY env var for non-loopback auth - cost_usd: 0.0 (local inference) - Falls back to openai_tts → piper_tts Note: VoiceStudio does not support with_timestamps (ElevenLabs word-level alignment). A separate /v1/speech-to-text pass is needed for captions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass 1: POST /elevenlabs/v1/text-to-speech → audio Pass 2: POST /elevenlabs/v1/speech-to-text → word timings Assembles the same .alignment.json sidecar and word_timestamps structure that elevenlabs_tts produces, so caption sync and word-cued animation pipeline steps work without modification. No ElevenLabs API key used. Also upgrades the tool to match elevenlabs_tts class structure more closely: uses execute()/ToolResult, ResourceProfile, RetryPolicy, stability/execution_mode fields, and proper capabilities/supports metadata. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three test files covering unit (mocked), integration (live VoiceStudio), and cross-provider parity (VoiceStudio vs ElevenLabs). Integration and parity tests are skipped unless OPENMONTAGE_ALLOW_NETWORK=1 is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three test files covering unit (mocked), integration (live VoiceStudio), and cross-provider parity (VoiceStudio vs ElevenLabs). Integration and parity tests are skipped unless OPENMONTAGE_ALLOW_NETWORK=1 is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three test files covering unit (mocked), integration (live VoiceStudio), and cross-provider parity (VoiceStudio vs ElevenLabs). Integration and parity tests are skipped unless OPENMONTAGE_ALLOW_NETWORK=1 is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #983
Summary
tools/audio/voicestudio_tts.py— aBaseToolsubclass integrating VoiceStudio as a fully-local, zero-cost ElevenLabs alternativetts_selector.pyauto-discovers it viacapability = "tts"and@register_tool— no other files need changingget_status()probes VoiceStudio's/.well-known/voicestudio-speechhealth endpoint, so the tool only activates on machines where VoiceStudio is actually runningwith_timestamps — two-pass local approach
ElevenLabs supports a
/with-timestampsendpoint that returns word-level alignment alongside the audio. VoiceStudio has no equivalent TTS endpoint, so this tool implements the same result via two fully local passes:Pass 1 — TTS:
POST /elevenlabs/v1/text-to-speech/{voice_id}→ audio bytesPass 2 — STT:
POST /elevenlabs/v1/speech-to-text→ the generated audio is fed back to VoiceStudio's own speech-to-text endpoint, which returns word-level timestampsThe word timings are then assembled into the same
.alignment.jsonsidecar andword_timestampsstructure thatelevenlabs_ttsproduces — caption sync and word-cued animation pipeline steps see no difference. No ElevenLabs API key is used at any point.How it works
VoiceStudio exposes an ElevenLabs-compatible API at
http://127.0.0.1:3900/elevenlabs. This tool hits:Supported output formats:
mp3_44100_128,mp3_44100_192,pcm_16000,pcm_24000,pcm_44100,wav_44100.Configuration
VOICESTUDIO_URLhttp://127.0.0.1:3900/elevenlabsOMNIVOICE_API_KEYComparison with
elevenlabs_ttswith_timestamps"default"Tests
tests/tools/test_voicestudio_tts.pytests/tools/test_voicestudio_tts_integration.pytests/tools/test_voicestudio_elevenlabs_parity.pyFallback chain
voicestudio_tts→openai_tts→piper_tts