Create a new instance of Sarvam AI TTS.
apiKey must be set to your Sarvam API key, either using the argument or by setting the
SARVAM_API_KEY environment variable.
Returns this TTS's capabilities
Returns the channel count of audio frames returned by this TTS
Returns the sample rate of audio frames returned by this TTS
Returns a SynthesizeStream that can be used to push text and receive audio data
Synthesize text to audio using Sarvam AI TTS.
Text to synthesize (max 2500 chars for v3, 1500 for v2)
Optional connOptions: APIConnectOptionsAPI connection options
Optional abortSignal: AbortSignalAbort signal for cancellation
A chunked stream of synthesized audio
Update TTS options after initialization.
When the model changes, only truly shared fields (apiKey, targetLanguageCode, pace, sampleRate, baseURL) carry over. Model-specific fields (speaker, pitch, loudness, temperature, enablePreprocessing) are dropped so resolveOptions re-applies the correct defaults for the new model.
An instance of a text-to-speech adapter.
Remarks
This class is abstract, and as such cannot be used directly. Instead, use a provider plugin that exports its own child TTS class, which inherits this class's methods.