Audio Processing
Silence Trimming
Remove unwanted leading and trailing silence from synthesized audio with a single flag.
How it works
Setting trim_silence=True instructs the TTS engine to strip silent segments at the beginning and end of the generated audio. This is particularly useful for telephony (IVR prompts) and notification audio where dead air degrades the user experience.
| PROPERTY | VALUE |
|---|---|
| Parameter | trim_silence |
| Type | bool |
| Default | False |
Example
python
config = TTSConfig(
model="zero-indic",
voice="Sunita",
response_format="mp3",
trim_silence=True,
)
result = await client.tts.synthesize("Your order has been shipped.", config=config)When to use
- Telephony (IVR/PSTN): Eliminates dead air before the caller hears the prompt.
- Notifications: Keeps audio clips tight for push or in-app alerts.
- Concatenated audio: Prevents gaps when stitching multiple TTS segments together.