Back
Milestone
Posted

Created custom text-to-speech layer for switching between models

When I first wrote this app, I just wanted it to work. The problem is I hard-coded some text-to-speech functionality in the application, which meant switching between different models was tedious. I had a lot of if statements and duplicated logic.

Creating an abstraction was merely the first step. The next step required abstracting shared logic, but then also dealing with the fact some text-to-speech model providers return data in different formats and it needs to be parsed differently.

The end result was something that could be properly tested in isolation and also work with multiple providers and configurations.