Issue
The text-to-speech (TTS) system generated indistinguishable audio for both code and narrative text, making it difficult for users to distinguish between technical content and explanations. This created confusion, especially in tutorials where code examples blended with explanatory text.
Culprit
The system used a single voice for all text segments, lacking the ability to differentiate between code and narrative content. This included no segment-type awareness, voice switching capability, or boundary tracking for auditory separation.
Solution
A dual-voice architecture was implemented to use different voices for code segments and regular text. This included configurable pauses for auditory separation, enabling users to clearly distinguish between code examples and explanations. The system maintains backward compatibility while enabling future voice-specific styling and subtitles.