Skip to content

feat: add CAMB AI as TTS engine with voice cloning & audio separation#7

Open
neilruaro-camb wants to merge 1 commit into
heyncth:masterfrom
neilruaro-camb:feat/camb-ai-tts-integration
Open

feat: add CAMB AI as TTS engine with voice cloning & audio separation#7
neilruaro-camb wants to merge 1 commit into
heyncth:masterfrom
neilruaro-camb:feat/camb-ai-tts-integration

Conversation

@neilruaro-camb

Copy link
Copy Markdown

Summary

Hey! We're the team at CAMB AI — we build the localization engine behind the Premier League, NASCAR, the NBA, and other major sports organizations for multilingual audio/video content.

We love what you've built with youtube-auto-dub and would love to be integrated as one of the TTS options. This PR adds CAMB AI as an optional, high-quality TTS backend alongside the existing Edge TTS support.

What's included

  • TTS Provider abstraction — pluggable TTSProvider interface so users can choose between Edge TTS (free) and CAMB AI
  • CAMB AI TTS — supports MARS-Flash (low latency), MARS-Pro (studio quality), and MARS-Instruct (director control) models
  • Voice cloning — clone the original speaker's voice from a 20s sample, so the dubbed video sounds like the same person speaking another language
  • Audio separation — isolate vocals from background music/SFX via CAMB AI, preserving the original soundtrack in the dubbed output
  • Activated the dubbing pipeline — the existing Engine.synthesize() and media.fit_audio() code was never called; this PR wires it up end-to-end

New CLI flags

Flag Description
--tts-engine {edge,camb} Choose TTS backend (omit for subtitle-only mode)
--camb-model {mars-flash,mars-pro,mars-instruct} CAMB AI model tier
--voice-clone Clone original speaker's voice
--voice-id <int> Use a specific CAMB AI voice
--separate-audio Preserve background music via audio separation

Backward compatible

  • No breaking changes — existing subtitle-only workflow is untouched
  • CAMB AI features are entirely opt-in (require CAMB_API_KEY env var)
  • Edge TTS remains free and works without any API key

Tested with

  • 10-minute YouTube video dubbed to Spanish
  • CAMB AI TTS (mars-flash) — all 157 chunks synthesized successfully
  • Voice cloning — auto-extracts 20s sample, clones speaker identity
  • Edge TTS dubbing — confirmed working as alternative
  • Audio separation — vocals/background split, background preserved at 50% volume
  • Subtitle-only mode — no regressions

Test plan

  • python main.py "URL" --lang es (subtitle-only, regression test)
  • python main.py "URL" --lang es --tts-engine edge (Edge TTS dubbing)
  • python main.py "URL" --lang es --tts-engine camb (CAMB AI dubbing)
  • python main.py "URL" --lang es --tts-engine camb --voice-clone (voice cloning)
  • python main.py "URL" --lang es --tts-engine camb --separate-audio (audio separation)

- Add pluggable TTSProvider abstraction (Edge TTS + CAMB AI)
- CAMB AI TTS with MARS-Flash, MARS-Pro, MARS-Instruct models
- Voice cloning from original speaker audio (auto 20s sample extraction)
- Audio separation via CAMB AI to preserve background music
- Activate the dubbing pipeline (synthesize + fit_audio + concat + render)
- New CLI flags: --tts-engine, --camb-model, --voice-clone, --voice-id, --separate-audio
- Fix faster-whisper MPS compatibility (fallback to CPU)
- Graceful subtitle handling when FFmpeg lacks libass
- Fully backward compatible: subtitle-only mode unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant