Issue
The text-to-speech (TTS) system only supported English pronunciation, which led to mispronunciation of technical terms (e.g., Python/JavaScript code) when generating multilingual videos. For example, non-English pipelines would incorrectly pronounce code keywords using native language phonetics, reducing intelligibility.
Culprit
The system used a single pipeline for all content types, forcing either English-only output or native language conversion without distinguishing between code and text segments. This caused:
- Code segments being pronounced with native phonetics (e.g., ‘def’ pronounced in Japanese).
- No separation between phonetic processing (code required English) and voice selection (text could use native language).
Solution
A dual pipeline architecture was implemented to handle content-type routing:
- Code segments were processed through an English pipeline to ensure correct pronunciation of technical terms.
- Text segments used native language pipelines with language-specific voices.
- Configuration was simplified via environment variables to support multiple languages.
- Fallback behavior ensured backward compatibility with existing English-only workflows.
This approach resolved mispronunciation issues while enabling multilingual support.