Skip to main content
Use this when your audio comes from phone calls: a telephone line, an IVR, a contact-centre platform or a SIP trunk, usually at 8 kHz.

Turn it on

For live calls, connect to Realtime streaming with x-sample-rate: 8000 and the telephony voice-activity settings. This example streams the 8 kHz sample clip in real time:
Download the sample first: curl -o phone.wav https://docs.gnani.ai/audio/samples/phone-8k-hi-IN.wav. For recorded calls, send the file as it is to REST (up to 30 seconds) or Batch; no sample-rate setting is needed there.

Examples

The same sentence twice: once at 16 kHz, and once made directly as 8 kHz G.711 µ-law, the usual telephone encoding, then decoded to 16-bit PCM (synthetic, Timbre v3.0). What is said: नमस्ते, मैं Inya से प्रियंवदा बोल रही हूँ। आपका NACH mandate कल Vachana पर रिन्यू हो जाएगा। On REST with language_code=hi-IN: At 8 kHz both models kept the sentence; the hardest word, the product name Vachana, is where they differed. In two more runs of the 8 kHz audio, Prisma v3.0 wrote it as 1 January: once as a Batch job with the same WAV, and once on REST with the audio left as a µ-law WAV. With keyterms (["Inya","प्रियंवदा","NACH mandate","Vachana"]) every name came out right. Each REST request gave the same result both times it was run.

By interface

Send raw 16-bit mono PCM in 1,024-byte frames, one every 64 ms at 8 kHz, with x-sample-rate: 8000. The rate must match your audio. Use the telephony voice-activity settings (presets):For IVR menus and short commands, a shorter x-min-silence-ms (around 300) returns each answer sooner.

By model

Both models take 8 kHz audio on every interface, and the telephony settings are the same for both. In the example, Prisma v2.5 spelled out NACH as letters at both sample rates, while Prisma v3.0 kept it as NACH mandate. On Prisma v3.0, keyterms helps most with phone audio; on Prisma v2.5, use word boosting.

Rules and limits

Things to watch for

  • A wrong x-sample-rate garbles the transcript. 8 kHz audio sent as 16000 plays at double speed to the model. Read the rate from your telephony platform, not from a default.
  • Decode µ-law and A-law before streaming. Phone systems often deliver G.711 µ-law or A-law, but Realtime takes only 16-bit PCM. In Python, audioop.ulaw2lin(data, 2) does it (on Python 3.13 and later, install the audioop-lts package). For files sent to REST or Batch, prefer 16-bit PCM WAV: µ-law WAV is not a documented format, even though REST accepted one in testing.
  • Rare words suffer first on phone audio. Names, brands and codes are the most likely to change, as Vachana did in the example. Use keyterms or word boosting.
  • One speaker per channel. If your platform records the caller and the agent on separate channels, stream each channel on its own Realtime connection rather than mixing them. On Batch, see is_multi_channel in Configuration.
  • Send frames at real-time pace. Sending a recording faster than real time makes voice-activity detection less accurate.
  • Python SDK: the stream client’s options are sample_rate, vad_threshold, min_speech_ms and min_silence_ms.

Voice activity detection

Every VAD header, its range, and when to change it.

Improve names and terms

Keep names and codes right on noisy, narrowband audio.

Label speakers

Who said what in recorded calls.

Phone audio from Text-to-Speech

µ-law and A-law output for the other side of the call.
Last modified on December 2, 2026