Overview
Thetext_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
The text description of the sound effect you want to generate.
Output format of the generated audio. Formatted as codec_sample_rate_bitrate.Examples:
mp3_22050_32- MP3 with 22.05kHz sample rate at 32kbpsmp3_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
Whether the sound effect should be designed to loop seamlessly.
Target duration of the generated sound effect in seconds.
How closely the generation should follow the text prompt. Range: 0.0 to 1.0.
The ID of the sound effects model to use.
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
Related Methods
- Text to Speech - Convert text to speech
- Music Generation - Generate music from prompts