Как использовать Gemini 3.8 Flash TTS
-
Define your speakers: Добавьте one entry за голос , чтобы speakers list. Give each speaker_id in "Speaker N" дляmпри, pick voice_name, и set accent, style, и pace. При желании add audio_profile describing заsona.
-
Write dialogue: Fill dialogue_turns с илиdered lines. Каждый turn's speaker_id must mприch speaker you defined. Вы можете embed , чтобыne tags inline such as [whispers], [shouting], или [determination].
-
Задайте mood (optional): Используйте scene , чтобы describe acoustic setting и sample_context , чтобы set overall narrприion , чтобыne. Adjust temperature (0-2) для mилиe или less varied delivery.
-
Отправьте и poll: POST запрос, n poll /predictions/{request_id}/result until stприus — completed , чтобы get audio URL.
curl -X POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"speakers": [
{"speaker_id": "Speaker 1", "voice_name": "Fenrir", "accent": "British (RP)", "style": "Deadpan", "pace": "Natural"},
{"speaker_id": "Speaker 2", "voice_name": "Puck", "accent": "American (Gen)", "style": "Empathetic", "pace": "Staccato"}
],
"dialogue_turns": [
{"speaker_id": "Speaker 1", "text": "[shouting] Halt, traveler!"},
{"speaker_id": "Speaker 2", "text": "[determination] I carry a message for the elder."}
],
"scene": "A dark, crumbling dungeon.",
"temperature": 1
}'