CambEngine uses the CAMB AI MARS text-to-speech API through camb-sdk.
pip install "realtimetts[camb]"Set the API key in the environment or pass it to the constructor:
$env:CAMB_API_KEY = "..."from RealtimeTTS import TextToAudioStream, CambEngine
if __name__ == "__main__":
engine = CambEngine(voice_id=147320, language="en-us")
stream = TextToAudioStream(engine)
stream.feed("Hello from CAMB.")
stream.play()- Constructor defaults are
voice_id=147320,language="en-us",speech_model="mars-flash", andoutput_format="wav". speech_modelcan bemars-flash,mars-pro, ormars-instructaccording to the source docstring.user_instructionsis only sent when usingmars-instruct.get_voices()currently returns an empty list. Use numeric voice IDs orCambVoice.- The engine reports a custom stream format because API output can be WAV or MP3.
- Missing key errors can be fixed by passing
api_keyor settingCAMB_API_KEY. - If instructions are ignored, check that
speech_model="mars-instruct"is set.