Shaving Latency Off Real-Time Speech Translation: What Actually Worked in Our Flutter App
In a chat app, a slow reply is mildly annoying. In a spoken conversation, it breaks the exchange. Silence feels longer than a spinner does, and people judge the delay from the moment they stop speaking, not from when a request reaches a server. We build Owll Translator , a real-time interpretation app. You wear earbuds, speak normally, and the app translates live. It can also speak the…
In a real-time speech translation app, perceived latency is critical. Users judge delays from the moment they stop speaking, not when a request reaches a server. To minimize latency, we built Owll Translator, an app that translates speech in real-time. Users wear earbuds, speak normally, and the app translates live. We tested various approaches to reduce latency, but most work focused on hiding and minimizing unavoidable delays.
This post covers our findings, what worked, what didn't, and what remains unclear. Note that we don't have precise end-to-end latency numbers, so no specific millisecond claims are made. The article is divided into two main paths: client-orchestrated and server-orchestrated.
For the client-orchestrated path, we pre-fetch the authentication token, create a conversation session, and connect early. This reduces the time between tapping "Start" and the app beginning to listen. We also pre-warm the session by creating it ahead of time and enabling pre-connect audio. However, simply starting the recorder once the SDK reports it's ready can lead to missing the first words of the user's speech.
To address this, we buffer audio and flush it as soon as the push stream is available. This ensures we capture the user's first words, even if the recognition SDK isn't ready yet.
For the server-orchestrated path, we use LiveKit on top of WebRTC. We handle audio tracks, translation, and text-to-speech (TTS) within the server. We also transmit captions and events through the data channel. For perceived latency, we split partial translations into complete clauses and submit them only when they're fully formed. This ensures the user hears translated speech as soon as possible, even if the original speech contains incomplete thoughts.
In summary, minimizing perceived latency in real-time speech translation requires a combination of pre-warming sessions, buffering audio, and splitting partial translations into complete clauses. While we don't have exact latency figures, these techniques significantly reduced the delay experienced by users.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to