Package edu.tufts.hrilab.tts.cartesia
Class CartesiaSynthesisBackend
java.lang.Object
edu.tufts.hrilab.tts.cartesia.CartesiaSynthesisBackend
- All Implemented Interfaces:
SynthesisBackend
Cartesia cloud TTS over a shared websocket. Phrases for one utterance are chained on a
context_id with continue=true; the server streams PCM chunks back and signals done after
the final continue=false send.
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.tufts.hrilab.tts.SynthesisBackend
SynthesisBackend.Engine, SynthesisBackend.Session, SynthesisBackend.Sink -
Constructor Summary
ConstructorsConstructorDescriptionCartesiaSynthesisBackend(String voiceId, String model, String language, String speed) -
Method Summary
Modifier and TypeMethodDescriptionintOutput PCM rate (s16le mono), fixed for the backend's lifetime.voidinit()Load credentials and prewarm the transport.booleanisReady()False if the backend cannot synthesize at all (e.g.Begin one utterance's synthesis.voidshutdown()Release transport resources.
-
Constructor Details
-
CartesiaSynthesisBackend
-
-
Method Details
-
init
public void init()Description copied from interface:SynthesisBackendLoad credentials and prewarm the transport. Called once from component init.- Specified by:
initin interfaceSynthesisBackend
-
isReady
public boolean isReady()Description copied from interface:SynthesisBackendFalse if the backend cannot synthesize at all (e.g. missing credentials).- Specified by:
isReadyin interfaceSynthesisBackend
-
getSampleRate
public int getSampleRate()Description copied from interface:SynthesisBackendOutput PCM rate (s16le mono), fixed for the backend's lifetime. Valid after init.- Specified by:
getSampleRatein interfaceSynthesisBackend
-
openSession
Description copied from interface:SynthesisBackendBegin one utterance's synthesis. Never returns null when isReady.- Specified by:
openSessionin interfaceSynthesisBackend
-
shutdown
public void shutdown()Description copied from interface:SynthesisBackendRelease transport resources. Called from shutdownComponent.- Specified by:
shutdownin interfaceSynthesisBackend
-