Skip to main content

Overview

The text_to_sound_effects client provides methods to generate realistic sound effects from text descriptions using advanced AI models.

convert()

Generate sound effects from a text description.

Method Signature

Parameters

str
required
The text description of the sound effect you want to generate.
AllowedOutputFormats
Output format of the generated audio. Formatted as codec_sample_rate_bitrate.Examples:
  • mp3_22050_32 - MP3 with 22.05kHz sample rate at 32kbps
  • mp3_44100_192 - MP3 with 44.1kHz at 192kbps (requires Creator tier+)
  • pcm_44100 - PCM with 44.1kHz (requires Pro tier+)
  • ulaw_8000 - μ-law format commonly used for Twilio
bool
Whether the sound effect should be designed to loop seamlessly.
float
Target duration of the generated sound effect in seconds.
float
How closely the generation should follow the text prompt. Range: 0.0 to 1.0.
str
The ID of the sound effects model to use.
RequestOptions
Request-specific configuration.

Returns

Iterator[bytes] - Streaming audio data in the specified format.

Example

Use Cases

  • Video Production: Add realistic sound effects to videos
  • Voice-overs: Enhance narration with ambient sounds
  • Game Development: Generate dynamic sound effects for games
  • Podcasts: Create custom audio branding and transitions

Async Usage