Gemini 3.8 Flash TTS का उपयोग कैसे करें
-
वक्ताओं को परिभाषित करें: speakers सूची में हर आवाज़ के लिए एक प्रविष्टि जोड़ें। प्रत्येक को speaker_id "Speaker N" फ़ॉर्मैट में दें, voice_name चुनें और accent, style तथा pace सेट करें। चाहें तो व्यक्तित्व का वर्णन करने वाला audio_profile भी जोड़ें।
-
संवाद लिखें: dialogue_turns में क्रमबद्ध पंक्तियाँ भरें। हर टर्न का speaker_id आपके परिभाषित वक्ताओं में से किसी एक से मेल खाना चाहिए। आप [whispers], [shouting] या [determination] जैसे टोन टैग इनलाइन जोड़ सकते हैं।
-
माहौल तय करें (वैकल्पिक): ध्वनिक परिवेश बताने के लिए scene और कथन का समग्र टोन तय करने के लिए sample_context इस्तेमाल करें। प्रस्तुति में विविधता कम या ज़्यादा करने के लिए temperature (0-2) समायोजित करें।
-
अनुरोध भेजें और स्थिति जाँचें: अनुरोध POST करें, फिर ऑडियो URL पाने के लिए /predictions/{request_id}/result को तब तक पोल करें, जब तक स्थिति completed न हो जाए।
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
}'