Give each spoken turn an explicit voice identity
A short two-character exchange is a useful manageable case: speaker A asks, speaker B replies and speaker A reacts. The output is an audio conversation that still needs a separate visual presentation. Unlike an avatar podcast tool, this endpoint does not establish Host and Guest pictures or generate a scene. Keep the speaker map, text order and selected output audio together. The current Create dialogue API reference limits unique voice IDs and advises a bounded total text length even though broad capability wording may describe speakers differently. A schema-correct request is the first gate; an intelligible finished exchange with the right voices remains the real acceptance artifact.
What to do next
- 01
Prepare a role-to-voice map and ordered script
Assign stable role keys to the two approved voices and record the voice_id associated with each. Use voices you are permitted to use for the intended project. Break the script into actual conversational turns rather than one paragraph containing ambiguous character names. Mark interruptions or emotional delivery as creative requirements, but do not assume punctuation enforces an exact frame duration or prevents every unintended overlap.
- 02
Construct and validate the native request
Use POST /v1/text-to-dialogue with inputs containing text and voice_id for each ordered item. Put a relevant delivery tag inside the affected turn's text; do not replace voice_id with that tag. Check the current API reference's maximum of ten unique voice IDs and its recommendation to keep total inputs[].text at or below 2,000 characters for reliable generation. This two-speaker example stays within both. Keep credentials outside any client-facing request fixture or article example.
- 03
Review the whole dialogue before visual assembly
Listen to every turn and compare its actual voice with the mapping. Check missing words, unintended tag reading, emotional events, pauses and the actual ending. Preserve the accepted generated audio because another run can sound different; a seed is not a guarantee of identical results. If a visual duet is assembled later, qualify its timing against this exact file rather than assuming each textual turn corresponds to a known number of video frames. Keep any later edits distinguishable from the native audio output.
A concrete example
Illustrative request plan: A's permitted voice asks a question, B's permitted voice replies quietly and A laughs. The quiet instruction belongs inside B's text, while B's voice_id remains the identity field. If A's voice is accidentally copied into B's input item, a written B label elsewhere in the script does not fix the schema. The team checks the returned conversation before attaching any character pictures.
Dialogue request map
| Turn | Identity control | Delivery control |
|---|---|---|
| A asks | A voice_id | A text and relevant tags |
| B replies | B voice_id | B text and relevant tags |
| A reacts | A voice_id again | A response instruction |
| Output acceptance | Compare actual heard voices | Words, pauses and ending reviewed |
Before you call it ready
- Every turn has the intended voice_id and text.
- Delivery tags and voice identity are not conflated.
- The actual completed audio is accepted before downstream synchronization.
When to stop or choose another method
Stop when speaker mapping, voice permission or request completeness is unresolved. Split longer scripts according to the documented interface and qualify their joins separately. This is an ElevenLabs audio API workflow; it does not imply native two-person audiovisual generation inside AISwapLab.
