feat(audios): add CAMB AI as a TTS provider option#3428
Open
neilruaro-camb wants to merge 1 commit intokantord:mainfrom
Open
feat(audios): add CAMB AI as a TTS provider option#3428neilruaro-camb wants to merge 1 commit intokantord:mainfrom
neilruaro-camb wants to merge 1 commit intokantord:mainfrom
Conversation
Adds CambAI alongside the existing AWS Polly path in
_generate_audio_with_tts so course authors can synthesise lesson
audio with CAMB's mars-pro / mars-flash voices.
The change is opt in: courses keep using Polly unless their
course.yaml declares Provider: CambAI under Settings.Audio.TTS. No new
Python dependency is introduced; the call uses urllib from the standard
library and mp3 is requested directly so no post processing is needed.
Also fixes a small pre existing bug where the ttsProvider field in the
generated index JSON was hardcoded to "Polly" regardless of the actual
provider used.
Configuration:
export CAMB_API_KEY=<key>
# in course.yaml:
Settings:
Audio:
Enabled: True
TTS:
- Provider: CambAI
Voice: "170460"
Engine: mars-pro
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.
Hi from Camb AI
We are Camb AI, the localization engine of choice for brands like the Premier League, NBA, NASCAR, and the Australian Open. We work with rightsholders and platforms who need high quality, low latency text to speech and dubbing in dozens of languages.
We'd love to be added as a TTS option in LibreLingo, alongside the existing AWS Polly path. This PR keeps the change small, opt in, and behind the existing
Settings.Audio.TTSconfiguration surface, so it is easy to review and merge without affecting current courses.Happy to iterate on naming, defaults, docs, or anything else you'd prefer. Thanks for maintaining LibreLingo.
What this PR does
cambaibranch alongside the existingpollybranch in_generate_audio_with_tts(theif/elsehook insrc/librelingo_audios/update_audios.pythat already had a comment inviting more providers)._synthesize_with_cambaicalls Camb's/apis/tts-streamendpoint over HTTPS usingurllibfrom the standard library, so no new Python dependency is added. Camb returns mp3 directly, so no post processing is needed.ttsProviderfield was hardcoded to"Polly"regardless of the actual provider used. With this PR, the index correctly records whichever provider produced each audio file.How a user turns it on
export CAMB_API_KEY=<your key>(get one at https://studio.camb.ai).course.yaml, underSettings.Audio.TTS, add an entry:librelingo-audios <course-dir> <audio-out-dir> <name>.Testing
5 new pytest cases in
src/librelingo_audios/tests/test_cambai_provider.pycovering:CAMB_API_KEYenv var raises a clear error./list-voices.Full audio test suite passes locally: 25 of 25 tests in
src/librelingo_audios/tests/.About Camb AI
marsfamily, withmars-flashat about 150ms latency for real time use andmars-profor higher quality offline generation, which is the right fit for course build time TTS.