Build a Gemini Live voice agent as a continuous audio conversation, not a sequence of uploaded recordings: capture microphone audio, convert it to raw 16-bit PCM, stream it over a persistent session, and play the model’s audio response as chunks arrive. For a first server-side version, Google’s GenAI SDK provides an asynchronous Live API connection; for a browser that streams directly to Google, use an ephemeral token rather than exposing a long-lived API key.
How the Live API voice-agent loop works
The Gemini Live API is a stateful, bidirectional WebSocket service. A session can carry audio, video, and text input and return native audio, text, or function-call requests. Google’s GenAI SDK wraps the WebSocket in an asynchronous interface; a direct WebSocket gives you more control but requires you to manage the protocol and connection yourself.
As an Amazon Associate I earn from qualifying purchases.
- Configure and open a session. Select a model and set the response modality to audio. Add system instructions, voice configuration, and any function declarations in the initial session configuration.
- Capture microphone audio. Convert it to the Live API’s expected PCM format and send short chunks while the person is speaking.
- Receive the model’s events. Read the session output continuously. When audio arrives, pass each chunk to the local playback path rather than waiting for the whole answer.
- Handle events and tools. Stop local playback when the server signals an interruption. If the model requests a function, run only an authorized function in your application and return its result.
- Manage the session lifecycle. Account for credentials, reconnects, context growth, and session limits before putting the agent into production.
For a first server-side implementation, the SDK guide’s connection entry points are client.aio.live.connect(...) in Python and ai.live.connect(...) in JavaScript. The SDK examples use raw PCM audio blobs for realtime input and a receive loop for model output. Keep sending and receiving active for the lifetime of the conversation; the API is not designed as a one-request, one-response transcription endpoint.
Choose a model and connection architecture
Model choice
Google’s capabilities guide, checked on October 5, 2026, recommends gemini-3.8-live as the default for most low-latency voice-agent experiences and gemini-3.8-live-extended-thinking when more background reasoning is important. The guide describes Gemini 3.1 Flash Live Preview as a legacy option. Model identifiers and availability can change, so verify the current model list before deploying rather than copying a name from an older example.
#1 Best Overall
- Without Built in Speaker- Please note that AIRHUG 21 microphone for pc does not have a speaker function. Built in an excellent 360° omnidirectional microphone pick up your voice within adius 6 ft. You don't have to loudly speak up to the computer or laptop
- Be Hear Your Clear Voice - With an advanced AIRHUG noise-canceling technology, better than traditional microphone technology. The sampling rate of the pc microphone is 48k hz. When at the online calls, the other side hear your clear and real voice
- AI Noise Reduction Mode - AIRHUG 21 USB microphone is with AI Noise Reduction Mode,eliminating background noise such as fans noise, keyboard clicks, and general background noise.Provide clear and crisp online calls for you.Great for your online learning,podcasting,conferencing and gaming. For a natural, realistic sound that captures your true voice with high fidelity, we recommend switching to Original Mode (Green Light)
- Smart Memory& Mute Function& LED Indicator - Every restart, the computer microphone starts in recording mode (not muted), so you never miss sound by accident. It also remembers your last sound mode (noise reduction or original). No need to adjust every time. Every recording starts the way you like, easy and simple. You can direct operate mute mode for this pc microphone. The built-in indicator light of mic informs the status(Blue: AI Noise Reduction; Green: Original Mode; Red: Muted)
- Widely Compatible Feature - AIRHUG 21 external microphone for laptop is great for small conference with 1-3 participants. The conference microphone is compatible with Zoom,Skype,Microsoft,Teams,Google meeting,Webex,Facetime, and most of the online meeting apps. It is a great choice for anyone who needs to make video meeting, online education,seminars, remote training, business negotiations,etc
Do not assume that every tool works with every Live model. The tools guide’s support table lists Search and synchronous function calling for Gemini 3.1 Flash Live Preview, and Search plus synchronous or asynchronous function calling for Gemini 2.5 Flash Live Preview. It lists Google Maps, code execution, and URL context as unsupported in that table. That is model-specific documentation, not a guarantee about other models; check the current table for the model you select.
Where the session should run
| Approach | Best fit | Trade-off |
|---|---|---|
| GenAI SDK on your server | A first implementation, or an application that should keep credentials and tool execution on its backend. | The SDK reduces protocol work, but relaying media through your server adds an intermediary hop. |
| Direct browser-to-Google connection | Applications where avoiding a media proxy is important for the real-time audio path. | The browser must receive a short-lived ephemeral token from a trusted backend. Never ship a long-lived API key in client code. |
| Direct WebSocket implementation | A team that needs lower-level control over messages and session behavior. | You must implement setup, protocol handling, authentication, event parsing, and lifecycle management yourself. |
Google’s API overview describes client-to-server connections as generally better for media performance because they avoid an extra proxy hop, and recommends ephemeral tokens for production client connections. If you use a server-side session instead, keep the standard credential and privileged application logic on the server.
Capture and stream microphone audio in the required format
For native audio input, send raw little-endian 16-bit PCM at 16 kHz. The audio blob’s MIME type must identify the sample rate; for example, use audio/pcm;rate=16000 for 16 kHz input. A microphone commonly produces audio at a different rate, such as 44.1 or 48 kHz, so convert or resample it before sending. Google notes that the API can resample input, but its best-practices guidance recommends handling typical microphone resampling in the application.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #2
- Built-in AI Noise Reduction: Compared to the base model, G11 pro upgraded AI noise cancellation, effectively eliminates distractions like fan noise, keyboard clicks. It delivers clear, crisp teleconferencing experiences, making it perfect for conference calls, online learning and chatting
- Omnidirectional Conference Mic: Features omnidirectional pickup pattern with a pickup distance of 11.5 ft, making it easy to capture sounds from 360° directions. Highly sensitive pickup ensures participants hear everything clearly. Tips: This is not a speaker
- Effortless Control: Physical volume and monitoring control buttons are built into the microphone body, allowing you to effortlessly adjust both microphone and monitoring volume. Click to adjust volume between 4 levels
- Mute & Monitor: Quickly mute/unmute your microphone by one tap. Built-in 3.5mm jack allows connection of headphones for monitoring. Long press for 3 seconds to enable/disable: Blue-Mic mode, Red-Mute, Purple-Monitoring. Note: Do not connect the 3.5mm jack to external speakers, as this may cause feedback interference
- Plug & Play: Compatible with all operating systems,both Windows and macOS. No additional drivers needed . If there is no response after inserting the mic, please go to the microphone setting of your computer and select the mic as the INPUT device
Send short chunks rather than buffering a long recording. Google recommends 20–40 ms audio chunks and warns against waiting to accumulate a full second before transmitting. Smaller, regularly sent chunks let the session process speech while the user is still talking; buffering a long interval delays the start of that interaction.
- Capture audio continuously while the user is speaking.
- Convert to raw, little-endian, signed 16-bit PCM at 16 kHz.
- Set the blob MIME type to include the actual input sample rate.
- Send chunks around 20–40 ms long instead of waiting for a large buffer.
- If continuous microphone input pauses for more than about a second, send an
audioStreamEndevent to flush cached audio, as described in Google’s capabilities guide.
The API’s voice-activity detection (VAD) is enabled by default for continuous audio. It detects speech activity and supports natural turn-taking, including interruptions; you still need to manage the audio already queued in your own playback system.
Receive and play the response as it arrives
Native output audio is raw 16-bit PCM at 24 kHz. Treat it as a stream: inspect incoming model-turn content, extract audio chunks, and feed them incrementally to a playback path configured for that output format. Waiting for a complete, long answer before starting playback defeats the purpose of a real-time voice interaction.
Rank #3
- BUILT FOR DICTATION & VIBE CODING – Talk to your AI assistant, dictate code, or draft documents by voice. The Movo WebMic's clear, close-up capture means fewer transcription errors so your words land right the first time.
- CARDIOID PICKUP FOR CLEAN VOICE-TO-TEXT – The directional cardioid capsule focuses on your voice and rejects noise from behind, giving speech-to-text engines and AI prompts the clean input they need to stay accurate.
- HANDS-ON CONTROLS, ONE-TOUCH MUTE – Built-in knobs adjust mic gain and headphone monitoring level, a 3.5mm headphone jack lets you hear yourself live, and one-touch mute keeps you in control during calls and long coding sessions.
- PLUG AND PLAY ON PC & MAC – Connect over USB with no drivers or extra hardware. Works instantly with your dictation app, AI coding tools, and voice typing — the LED glows to show you're connected and turns red when muted.
- DESKTOP STAND + 1-YEAR WARRANTY – Includes a desktop stand that keeps the mic at talking distance on your desk, backed by friendly US-based support and a 1-year warranty.
Keep output playback separate from the receive loop. The receive loop must continue processing session events even while audio is playing, because an interruption or function-call request may arrive before the current spoken response has finished. Your playback code should track queued audio so it can discard stale chunks when the conversation changes direction.
Stop playback when the user interrupts
When the session reports serverContent.interrupted as true, stop current playback and clear locally queued audio. The server cancels ongoing generation, but audio already handed to a browser or device can continue playing unless the application removes it. Failing to clear that queue can make the agent appear to ignore the user even though generation has stopped.
- Listen for the interruption event in the receive loop.
- Stop the active audio source or playback stream.
- Clear pending response chunks from the local playback queue.
- Resume playback only with audio belonging to the next current model turn.
Add function calling without handing control to the model
Function calling lets the model ask your application to do work; it does not mean the model executes your code. Declare the functions available to the session, then treat each call as an untrusted request that must pass your application’s validation and authorization checks.
Rank #4
- 【Plug & Play Microphone】 Directly connect to a computer/laptop and use—no drivers needed. Compatible with macOS Windows PC iPhone Android for video conference, online teaching, Zoom calls, gaming, and podcast. Note: Set UM04 as the default input device on a PC if multiple audio devices are connected. Some phones may require OTG activation
- 【Mute/AI Noise Cancellation/RGB】 Built with the DSP chip. Tap once to mute (red light on); tap twice to enable AI noise cancellation (green light on); tap and hold for 3s to turn dynamic RGB light effects on or off
- 【Omnidirectional Pickup Pattern】 360° omnidirectional pattern evenly captures sound from all directions—portable mic and professional microphone for group online meetings or use by multiple persons in conference room. Optimal pickup distance: 4.9ft/1.5m
- 【3.5mm TRS Headphone Jack】 Plug monitoring headphones into the 3.5mm jack to monitor audio in real time or in playback. Only supports 3.5mm TRS headphone output. Note: It is a microphone, not a speaker or speakerphone
- 【10 Volume Adjustment Levels】 Supports 10 adjustable volume levels and mic gain control (2dB increments). Intuitive light effects, dynamic during volume adjustment, solid at max or min level, allow you to know the status at a glance
- Receive the function-call event and identify the declared function, call ID, and arguments.
- Reject unknown functions, malformed arguments, or requests the current user is not allowed to make.
- Execute the approved function in trusted application code. For a consequential action, design any needed user confirmation and recovery behavior in the application.
- Return a
FunctionResponsecontaining the function name, call ID, and result using the SDK’s function-response method. - Continue receiving the session so the model can incorporate the returned result into its next response.
Google documents function calling and Search as Live API tools, but model support varies. Check the chosen model’s current support documentation before depending on a tool.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Plan credentials, reconnects, and long conversations
Protect credentials
For a direct browser connection, have a trusted backend issue an ephemeral token and give the client that short-lived credential. Do not put a standard, long-lived API key into JavaScript or another downloadable client. For a server-side connection, keep credentials on the server and perform privileged tool execution there.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Handle session endings and reconnects
Google’s capabilities guide lists session durations of 15 minutes for audio-only sessions and 2 minutes for audio-plus-video sessions without session-extension techniques. The guide says session-management techniques can extend duration. Design for sessions that end: handle server GoAway notifications, stop or finish local playback safely, and use session resumption where appropriate instead of assuming one socket can remain open indefinitely.
Best Value
- Thumb-Sized Mic: Weighing only 5 grams—the BOYA mini 2 lavalier microphone is the lightest microphone you can get. Its streamlined design seamlessly blends with your clothing for complete concealment and all-day comfort.
- Adaptive AI Noise Cancellation: Instantly suppresses noise from clicks to roars. Activate Strong mode (-40 dB) for loud environments, or Light mode (-15 dB) to maintain a natural sound atmosphere.
- 48kHz/24Bit Richer Sound: BOYA mini 2 microphone for iphone captures pristine audio with 48kHz/24-bit resolution for exceptional clarity. An 80dB signal-to-noise ratio ensures a pure recording, while a high 120dB SPL handles loud sounds without distortion.
- Smart App Control: Unlock the full potential of your BOYA mini 2 clip on microphone with the free BOYA Central app. This app gives you quick access to key settings like volume, noise cancellation, and EQ—all from your phone.
- Limiter & Safety Track: BOYA mini 2 lapel microphone wireless uses an limiter to prevent distortion by adjusting volume in real-time. A -12 dB safety track further guards against clipping, ensuring every recording is protected.
With raw WebSockets, send the setup message first. It configures the model, generation options, system instructions, and tools; configuration cannot be changed while that connection remains open, except through supported pause/resume mechanisms. Treat a reconnect as a lifecycle event that may require restoring session state, not as a transparent continuation unless you have implemented the documented resumption behavior.
Control context growth and cost
Session context accumulates, so later turns include earlier context and can cost more than earlier turns. Google’s best-practices guide approximates audio at about 25 tokens per second and recommends context-window compression and session resumption for longer conversations. The capabilities guide lists context-window limits of 128k tokens for native-audio-output models and 32k tokens for other Live API models; verify the applicable limit for the selected model.
Billing is token-based. There is no single useful per-session price without current pricing and an estimate of the application’s input, output, and conversation length, so check Google’s current pricing before budgeting rather than treating a token estimate as a quote.
Free tools Windows power users keep installed
One-click scans. No signup required.
When to use a real-time framework instead
The direct Live API is a natural fit when you want a custom voice agent and are prepared to own its audio, session, and tool lifecycle. Google also points developers to the Agent Development Kit Streaming route. Its overview names LiveKit Agents, Pipecat by Daily, Fishjam by Software Mansion, Vision Agents by Stream, Voximplant for phone-call connections, Agora, and Firebase AI SDK as integration options.
Consider a framework when your application needs broader real-time audio/video or telephony support, or when its existing media and agent abstractions fit better than building those parts yourself. Verify the integration’s current Live API capabilities and terms before choosing it; a framework name alone does not establish model support or behavior.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




