Sound Effects
Generate sound effects from text descriptions using .GENSoundEffect().
Basic Usage
AudioClip explosion = await "Massive explosion sound"
.GENSoundEffect()
.ExecuteAsync();
audioSource.clip = explosion;
audioSource.Play();Input Types
String Input
AudioClip sfx = await "Dog barking"
.GENSoundEffect()
.ExecuteAsync();Prompt Input
var prompt = new Prompt("Sound of {action} on {surface}");
AudioClip sfx = await prompt
.GENSoundEffect()
.ExecuteAsync();Configuration
Duration
Prompt Influence
Control how closely the AI follows your prompt (0.0-1.0):
Unity Integration Examples
Example 1: Dynamic SFX System
Example 2: Procedural Weapon Sounds
Example 3: Footstep System
Example 4: Environmental Ambience
Example 5: UI Sound Effects
Example 6: Combat Sound System
Prompt Engineering Tips
✅ Good Prompts
❌ Bad Prompts
Provider Support
ElevenLabs
Features:
✅ High-quality sound effects
✅ Duration control (0.5s - 22s)
✅ Prompt influence control
✅ Various acoustic styles
Note: Currently, ElevenLabs is the primary provider for sound effect generation.
Best Practices
✅ Good Practices
❌ Bad Practices
Limitations
Duration Limits: Typically 0.5s - 22s depending on provider
Quality: May not match professional sound design
Consistency: Same prompt may produce variations
Cost: Each generation counts toward API usage
Performance Tips
Error Handling
Common Use Cases
Footsteps
"Footsteps on gravel"
Weapons
"Sword slash through air"
Impacts
"Heavy object hitting wood"
UI
"Soft button click"
Ambience
"Forest ambience with birds"
Magic
"Magical spell casting sound"
Vehicles
"Car engine revving"
Weather
"Heavy rain on roof"
Next Steps
Voice Change - Modify voice characteristics
Audio Isolation - Clean up audio
Text to Speech - Generate speech
Last updated