How to Diagnose 303-Second Speech Synthesis Delays A developer traced intermittent voice-chat pauses to two distinct causes: GPT-4o-mini text-to-speech latency that ranged from 0.7–1.3 seconds to 48–303 seconds on the same day, and a retry loop that gave up after two consecutive rejections of unsupported settings fields. Reverting to the previously used TTS model brought roughly 40 runs back to 0.8–2.2 seconds, and a fix that retries after removing each rejected field, capped at eight attempts, let the app respond on the third request. 📝 Originally published in Japanese at forge.workstyle.tech https://forge.workstyle.tech/blog/gpt-4o-mini-tts-slow/?utm source=devto&utm medium=crosspost&utm campaign=gpt-4o-mini-tts-slow . TL;DR The reply text arrived quickly, but speech synthesis took as long as 303 seconds. Measurements that day ranged from 0.7–1.3 seconds to 48–303 seconds, with slow runs making up more than half. After reverting to the previous model, about 40 runs took 0.8–2.2 seconds. Speech synthesis took 0.7–1.3 seconds in some runs and 48–303 seconds in others, even when measured on the same day; more than half of the runs were slow. After switching back to the model I had used before, about 40 runs took 0.8–2.2 seconds. In a separate issue, retries stopped after two consecutive rejections of unsupported settings fields. After fixing the issue, tests confirmed that a response arrived on the third attempt. I compared the time taken by speech synthesis with the time taken to recognize speech and generate a reply. The sentences I measured were 90–175 bytes long a unit of data size . During the same period, speech recognition took 0.6–1.0 seconds, and reply generation took 0.7–1.9 seconds. After the reply text arrived, speech synthesis was the only step that made me wait a long time before hearing the audio. I sent a request to the speech synthesis service from within the app and waited for a response. There was no record of the app slowing things down while I waited. I had no evidence that I could reduce the wait time on the app side. The service status page showed normal operations that day, but that didn’t match the delays I was experiencing on my device. So I reverted the settings and decided to measure again on the actual device. I switched my speech synthesis model back to one I had used before. In the roughly 40 runs after switching, every result was between 0.8 and 2.2 seconds. Based on those results, I also reverted the settings I use for conversation. In this round of measurements, the experience went from waiting several minutes to getting back to a normal conversational pace. However, these were real-world measurements taken on the same device, with the same key, on the same day. These results alone don’t show that the speed will be the same in every environment. I thought I had resolved one cause of pauses in conversation. But later that same day, I noticed another kind of silence. This one wasn’t caused by speech synthesis latency. When I spoke to the conversation model with two unusable settings fields configured, it didn’t respond to my first utterance. When I sent it, the model rejected the first field as unusable. The app removed that field and sent the request again. Sending a failed request again is called a retry. Next, the model rejected the other field too. The previous mechanism only retried once, so processing stopped there. The first utterance was still met with silence. At first, I almost thought this was the same problem as when audio is delayed. But this happens before text-to-speech is called: the response itself hasn’t been generated. The two silences occurred at different stages. The fix retries the request after removing each field the model rejects. In the issue I reproduced on a real device, retrying after both the first and second rejections lets the app respond to the first utterance. For the test, I used a mock server that rejects the two fields in sequence. The first field is rejected on the initial request, and the second field on the next. On the third request, both fields have been removed, and a response comes back. If a request fails after any text has already been returned, the app doesn’t retry, to avoid displaying the same text twice. Retries are capped at eight. This time, I nearly treated two kinds of “no response” as the same thing. In one case, speech synthesis took time even after the text reply arrived. In the other, generation stopped midway after two consecutive rejections of unavailable fields. After restoring the speech synthesis settings, I measured about 0.8–2.2 seconds across roughly 40 runs on the actual device. After fixing the retry logic, tests confirmed that a reply came through on the third send, with the two fields removed. The speed measured on the actual device and the response confirmed by tests are separate records. When a conversation stalls, I look separately at how long it takes for the text to arrive and how long it takes for the audio to arrive. If the reply itself was never generated, I check how many retries happened after the send was rejected. I restored the speech synthesis settings and fixed the retry count. The silence looked similar, but the point where things stalled was different.