Skip to content

Add Camb AI as a transcription and translation provider#26

Open
neilruaro-camb wants to merge 1 commit intobuxuku:mainfrom
neilruaro-camb:camb-ai-integration
Open

Add Camb AI as a transcription and translation provider#26
neilruaro-camb wants to merge 1 commit intobuxuku:mainfrom
neilruaro-camb:camb-ai-integration

Conversation

@neilruaro-camb
Copy link
Copy Markdown

What this adds

A new Camb AI provider for transcription and translation, alongside the existing whisper.cpp and Baidu / Volcano / DeepLX / Ollama options. It is fully optional and off by default; users opt in by switching the providers in config.js after setting CAMB_API_KEY.

Files added or updated:

  • providers/camb.js (new) — transcription + translation implementation
  • service/camb.js (new) — thin shim matching the existing service/*.js signature used by translate.js
  • config.js — new supportedTranscriptionService map, camb entry in supportedService
  • translate.jscamb case in the provider switch
  • index.js — skips the whisper.cpp install when the Camb transcription provider is selected
  • .env.example and .env.local — add CAMB_API_KEY placeholder
  • package.json / package-lock.json — add @camb-ai/sdk dependency
  • README.md — short Camb AI section

Why Camb AI

Camb AI is the localization engine of choice for brands such as the Premier League, the NBA, NASCAR, and the Australian Open. We power dubbing and voice cloning across 140+ languages for their live and on-demand content. We think VideoSubtitleGenerator users would benefit from the same quality, so we would love to see Camb offered as an option in your project.

How it works

  • Authentication via the CAMB_API_KEY environment variable.
  • Uses the official @camb-ai/sdk Node client.
  • Task-based flow: createTranscription / createTranslation, poll status, fetch result.
  • Numeric language ids resolved from the live API on first use, so short codes like en or zh keep working from the existing config.

Verification

From a clone with CAMB_API_KEY set:

cp .env.local .env   # or export CAMB_API_KEY directly
npm install
# In config.js, switch to:
#   translateServiceProvider      = supportedService.camb
#   transcriptionServiceProvider  = supportedTranscriptionService.camb
node index.js

On the existing examples/demo.mp4, the run produces demo.en.srt and demo.zh.srt with 6 properly timestamped segments and fluent Chinese translations.

Notes

  • Camb's end-to-end dubbing endpoint is not added to this PR, since VideoSubtitleGenerator is a subtitle-focused CLI. Happy to add it in a follow-up if useful.
  • Default behavior is unchanged: transcription still uses whisper.cpp and translation still defaults to Ollama. Camb is available only when the config is switched.

Happy to iterate on naming, UX, or scope based on your preferences. Thank you for considering this.

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