How to change the speaker voice

The speaker parameter lets you choose a specific voice for the speech output.

Speaker Selection

Bulbul-v2 offers a variety of natural-sounding voices to suit different languages and use cases.Specify the speaker using the speaker parameter in your request.
It is an optional parameter - if omitted, the API uses the default voice Anushka.

Available Voices

Female Voices

  • Anushka: Clear and professional
  • Manisha: Warm and friendly
  • Vidya: Articulate and precise
  • Arya: Young and energetic

Male Voices

  • Abhilash: Deep and authoritative
  • Karun: Natural and conversational
  • Hitesh: Professional and engaging

Listen to voice samples here: Voice Samples – Sarvam TTS

Example Code

1from sarvamai import SarvamAI
2from sarvamai.play import save
3
4# Initialize the REST client
5client = SarvamAI(api_subscription_key="YOUR_API_SUBSCRIPTION_KEY")
6
7# Generate speech using REST
8audio = client.text_to_speech.convert(
9 text="Welcome to Sarvam AI!",
10 model="bulbul:v2",
11 target_language_code="en-IN",
12 speaker="anushka"
13)
14save(audio, "output1.wav")