synthesize_pair_batch
Synthesizes text pairs into MP3 audio files, combining each pair's first and second text with a pause—ideal for vocabulary flashcards and language listening practice.
Instructions
Synthesize multiple text pairs and stitch each into MP3 files.
Each pair becomes [text1 audio] [pause] [text2 audio]. Use for vocabulary lists like [["strong","stark"], ["house","Haus"]].
Args: pairs: List of [text1, text2] pairs. With ElevenLabs eleven_v3, texts can include audio tags like [tired], [excited]. voice1: Voice for all first texts. Defaults to provider's default. If lang1 is provided without voice1, auto-selects. voice2: Voice for all second texts. Defaults to provider's default. If lang2 is provided without voice2, auto-selects. lang1: ISO 639-1 language code for first texts (e.g. 'en'). lang2: ISO 639-1 language code for second texts (e.g. 'de'). rate: Speech rate as percentage. Defaults to 90. pause_ms: Pause between pair segments in milliseconds. Defaults to 500. merge: If true, produce one merged file instead of separate files per pair. Defaults to false. auto_play: Play the audio after synthesis. Defaults to true. output_dir: Directory for output files. Defaults to TTS_OUTPUT_DIR env var or ~/langlearn-audio/. stability: ElevenLabs voice stability (0.0-1.0). similarity: ElevenLabs voice similarity boost (0.0-1.0). style: ElevenLabs voice style/expressiveness (0.0-1.0). speaker_boost: ElevenLabs speaker boost toggle.
Returns: JSON string with list of results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | No | ||
| lang1 | No | ||
| lang2 | No | ||
| merge | No | ||
| pairs | Yes | ||
| style | No | ||
| voice1 | No | ||
| voice2 | No | ||
| pause_ms | No | ||
| auto_play | No | ||
| stability | No | ||
| output_dir | No | ||
| similarity | No | ||
| speaker_boost | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |