Text to Speech
Basic Usage
AudioClip speech = await "Welcome back, Commander!"
.GENSpeech()
.ExecuteAsync();
audioSource.clip = speech;
audioSource.Play();Input Types
String Input
AudioClip speech = await "Hello, world!"
.GENSpeech()
.ExecuteAsync();Prompt Input
var prompt = new Prompt("The {character} says: {dialogue}");
AudioClip speech = await prompt
.GENSpeech()
.ExecuteAsync();Alias Method
Configuration
Voice Selection
Model Selection
Voice Settings (ElevenLabs)
Audio Format
Speed Control
Unity Integration Examples
Example 1: NPC Dialogue
Example 2: Tutorial Narrator
Example 3: Dynamic UI Feedback
Example 4: Accessibility Reader
Example 5: Multi-Language Support
Example 6: Subtitle Generator
Provider Support
OpenAI
ElevenLabs
Best Practices
✅ Good Practices
❌ Bad Practices
Performance Tips
Error Handling
Limitations
Next Steps
Last updated