Back to library
AI
best practice

Reduce Voice App Latency Using New Gemini Speech Streaming Support

Enable streaming forSpeech-to-Text to reduce AI voice latency.

Implement the `streamGenerateContent` feature with the `gemini-3.1-flash-tts-preview` model to deliver real-time speech generation in your applications.

Google Gemini

The Scenario

An app developer is building a real-time voice assistant and wants to reduce the delay between a user asking a question and the AI speaking.

Before & after

The old way

Developers would wait for the full audio file to generate before playing it for the user, causing a latency of 15-30 seconds per interaction.

With AI

Updating model IDs and testing the new speech streaming outputs takes approximately 10-15 minutes using the API guides.

The Prompt

Show me a code example for implementing streaming speech generation using the 'gemini-3.1-flash-tts-preview' model in [PROGRAMMING_LANGUAGE].

Streaming is now supported for the `gemini-3.1-flash-tts-preview` model via the `streamGenerateContent` method or the `stream: true` flag in the Interactions API.

Source

Release notes  |  Gemini API  |  Google AI for Developers
"Streaming support for speech generation: Streaming via streamGenerateContent... is now supported for the gemini-3.1-flash-tts-preview model."