Voiceover
Overview​
Each dialog block can have a voiceover — AI-generated speech from the character's assigned voice.
Requirements​
- The character assigned to the block must have a Voice ID configured (ElevenLabs voice ID)
- The user must have
voiceover:generatepermission
Workflow​
1. Hover over a dialog block → click the microphone (🔊) button
2. VoiceMasterModal opens — shows the block's text pre-filled
3. Edit the text if needed (e.g. adjust pronunciation)
4. Click Generate → ElevenLabs TTS generates the audio
5. Audio auto-plays for preview
6. Click Accept to upload and save the voiceover to the block
— or —
Click Regenerate to try again
7. The block now shows a ring on the voice button indicating a saved voiceover
Listening to a saved voiceover​
The Listen button in the modal fetches the audio via apiFetch (with Bearer token) and plays it from a blob URL. The audio file is served by the backend API — direct <audio src> links won't work because they bypass auth headers.
Downloading​
Click the download button to save the MP3 file locally. This also uses apiFetch to fetch with auth, then triggers a browser download.
Deleting​
Click the trash icon (requires voiceover:delete). This deletes the stored audio file from the server and clears the voiceUrl on the block.
Inline playback (scene view)​
The play button on each dialog block in the scene view also plays the voiceover. It uses the same fetch-to-blob pattern.
API​
| Method | Endpoint | Description |
|---|---|---|
POST | /api/voices/:voiceId/generate | Generate speech (returns audio blob) |
POST | /api/voices/upload | Upload audio blob, returns stored URL |
DELETE | /api/voices/file | Delete a voice file by URL |