Text to speech realtime

sarvam-bulbul-live

Live Bulbul. $30 per million characters. linear16 at 24 kHz.

The call is Pascal’s. Send Authorization: Bearer with a Pascal key, and Pascal’s body: model, the file or the text, and params. Inside params, a Pascal name and the provider’s own name are both accepted. If both are sent and they disagree, the request is rejected. The provider’s SDK and host are not this API. The API request fee is not charged. A studio call needs a Creator plan or an API balance.

Native stream: wss://api.pascalai.co/v1/text-to-speech/realtime?model=sarvam-bulbul-live. Live price and availability are on GET /v1/models/sarvam-bulbul-live.

  • Send speak with the words. Audio comes back as linear16 at 24 kHz.
  • Language defaults to English (India). This model does not detect it. en-IN is that same default.

Parameters

FieldTypeDescription
session.language
Default en-IN
stringThis model does not detect the language. Omitted uses English (India). en or en-IN is that same default. Same codes as the file voice: en, hi, bn, gu, kn, ml, mr, pa, ta, te, or the -IN form. Odia is od or or. Both are the same.
session.speaker
Default shubh
stringA published Bulbul speaker.

Example

const socket = new WebSocket(
  'wss://api.pascalai.co/v1/text-to-speech/realtime?model=sarvam-bulbul-live&api_key=' + key
);
socket.binaryType = 'arraybuffer';
socket.onmessage = (event) => {
  if (typeof event.data !== 'string') return;
  const payload = JSON.parse(event.data);
  if (payload.type === 'session.created') {
    socket.send(JSON.stringify({ type: 'session.update', session: { speed: 1 } }));
    socket.send(JSON.stringify({
    type: 'speak',
    text: 'Keep walking toward the river.',
  }));
  }
};
// binary Int16 PCM16 frames, then response.done