Gemini live audio

From calesthio/generative-media-skills · View interactive version

Gemini live audio is an AI agent skill from the GitHub repository calesthio/generative-media-skills. Build and evaluate low-latency spoken, multimodal, and translation experiences with Google Gemini Live API and Gemini Enterprise Agent Platform Live API. Use when a media-production or voice-agent workflow needs real-time audio input/output, barge-in, voice configuration, live transcription, live tr

How to use this skill

Skill file

Gemini Live audio

Use this skill when the job is a live spoken interaction, not a batch narration render. Gemini Live is for bidirectional sessions: microphone or streamed media in, spoken model output back, with turn-taking, interruptions, tools, and session lifecycle concerns. If the deliverable is a finished voiceover, audiobook, podcast narration, or offline transcript, prefer a TTS or speech-to-text skill unless the user explicitly needs live turn-taking.

All volatile facts below were verified against official Google AI and Google Cloud documentation on 2026-07-10. Model names, preview/GA status, pricing, rate limits, supported regions, and governance controls change often; re-check official docs before production launch, procurement commitments, or regulated deployment.

Documented facts

Current shape of the product

Media and transport boundaries

Transcription, language, voice, and turn-taking

Tools and agent behavior

Sessions, auth, cost, quotas, and governance

Empirical / operational observations

No first-party benchmark is bundled with this skill. Do not invent latency or quality numbers. If the user cares about latency, run a project-specific measurement on the target network, browser/device, model, and deployment surface.

Operational observations from production voice systems that must be verified in the target app:

Production heuristics

Choose the right Gemini Live mode

Use Gemini Live Agent when the user needs:

Use Live Translation when the user needs:

Do not use Gemini Live as the primary tool when the user needs:

Architecture choices

For prototypes and trusted server environments, a backend-to-Gemini WebSocket is simplest:

  1. Browser/mobile captures mic and optional camera/screen frames.
  2. Client streams to your backend over WebRTC/WebSocket.
  3. Backend authenticates to Gemini, applies policy/tool gating, and forwards allowed media.
  4. Backend returns audio chunks, transcript events, tool confirmations, and state updates.

For lowest-latency client-to-Gemini connections, use ephemeral tokens:

  1. Client authenticates with your backend.
  2. Backend requests an ephemeral token, ideally constrained to model/config/tool policy.
  3. Client opens the Live API WebSocket with the token.
  4. Backend still controls tool execution, user identity, logging policy, and escalation.

Prefer client-to-Gemini only when you can still protect secrets, enforce allowed tools, record consent, and monitor abuse. Never ship a long-lived API key in a browser or mobile app.

System instruction design for spoken agents

Write the Live agent instruction as operational policy, not a long essay:

  1. Persona and role: who the agent is, voice/tone, domain, language.
  2. Conversation loop: what to ask once, what can repeat, when to summarize.
  3. Tool policy: exact conditions for each function, required confirmation before consequential actions, what to say while waiting.
  4. Safety/consent boundaries: recording notice, emergency limitations, privacy, escalation.
  5. Response style: short spoken turns, one question at a time, no markdown, no hidden chain-of-thought.

For spoken UX, keep responses short by default. Ask one question per turn. Confirm high-risk facts verbally before tool calls that spend money, alter accounts, make bookings, send messages, or disclose sensitive data.

Audio and latency setup

Use this starting point unless measurement says otherwise:

Tool-calling safety for voice

Classify tools before exposing them:

Make function schemas narrow. Include enums, units, locale, timezone, irreversible/action flags, and user-visible confirmation text in tool responses. Do not rely on the model to infer policy from function names.

Governance and consent

Before productionizing a Live audio experience, document:

For voice likeness and media rights, do not imply that a Gemini voice is a cloned human voice unless Google explicitly supports that workflow and the user has documented rights/consent. Avoid prompts that impersonate a real person, celebrity, employee, or customer without authorization.

Complete examples

Example 1: retail support voice agent with order lookup

Production intent: A low-latency spoken assistant answers product and order questions, can look up order status, and creates return labels only after confirmation.

Applicable mode: Gemini Live Agent, not Live Translation.

Model/surface to verify: gemini-3.1-flash-live-preview on Developer API for prototype; consider Gemini Enterprise Agent Platform for production support, IAM, data residency, and support/SLA.

Inputs and constraints:

Session config sketch:

{
  "model": "gemini-3.1-flash-live-preview",
  "response_modalities": ["AUDIO"],
  "output_audio_transcription": {},
  "input_audio_transcription": {},
  "speech_config": {
    "voice_config": {
      "prebuilt_voice_config": { "voice_name": "Kore" }
    }
  },
  "realtime_input_config": {
    "automatic_activity_detection": {
      "prefix_padding_ms": 300,
      "silence_duration_ms": 700
    }
  },
  "tools": [
    {
      "function_declarations": [
        {
          "name": "get_order_status",
          "description": "Look up status for an authenticated order when the user provides order ID and postal code.",
          "parameters": {
            "type": "object",
            "properties": {
              "order_id": { "type": "string" },
              "postal_code": { "type": "string" }
            },
            "required": ["order_id", "postal_code"]
          }
        },
        {
          "name": "create_return_label",
          "description": "Create a return shipping label only after the user explicitly confirms the order ID and return reason.",
          "parameters": {
            "type": "object",
            "properties": {
              "order_id": { "type": "string" },
              "reason": { "type": "string" },
              "confirmed_by_user": { "type": "boolean" }
            },
            "required": ["order_id", "reason", "confirmed_by_user"]
          }
        }
      ]
    }
  ]
}

System instruction excerpt:

You are Mira, a concise retail support voice assistant.
Speak in the user's language when you can do so clearly.
Ask one question at a time. Keep spoken answers under 20 seconds unless the user asks for detail.
For order lookup, collect order ID and postal code, then call get_order_status.
Before creating a return label, summarize the order ID and reason, ask "Should I create the return label now?", and call create_return_label only if the user explicitly says yes.
Never ask for full payment card numbers. If the user asks for a refund decision, explain you can create a return request but a human reviews refunds.
If the user interrupts, stop your current explanation and answer the new question.

Expected result:

Failure modes:

Variations:

Example 2: live speech-to-speech event translation

Production intent: Translate a presenter from Japanese to English in near real time for a remote audience.

Applicable mode: Live Translation with gemini-3.5-live-translate-preview, not a general Live Agent.

Inputs and constraints:

Workflow:

  1. Verify the source/target languages are supported on the current Live Translation doc.
  2. Configure Live API translation settings for source and target language.
  3. Capture presenter audio as PCM16, chunk 20-40 ms, and stream continuously.
  4. Play translated output with a jitter buffer tuned for intelligibility, not interruption-heavy dialogue.
  5. Record input/output timing, dropout, mistranslations, and audience feedback.

Expected result:

Failure modes:

Variations:

Example 3: field technician visual support agent

Production intent: A technician points a mobile camera at equipment and asks spoken questions. The agent can identify likely components, ask for another view, and open a support ticket.

Applicable mode: Gemini Live Agent with audio plus low-rate image/video input, if the selected model/surface supports it.

Inputs and constraints:

System instruction excerpt:

You are an equipment support assistant for trained technicians.
Use visual context only to guide inspection; do not certify equipment as safe.
Ask for a closer view, better lighting, or label photo when needed.
If a potential hazard is visible or described, tell the technician to follow their site safety procedure and stop remote troubleshooting.
Before creating a support ticket, summarize the observed issue, asset ID, severity, and photos to attach, then ask for confirmation.

Expected result:

Failure modes:

Variations:

Production QA checklist

Before shipping, test with real devices and noisy environments:

Source ledger

Official sources used and verified on 2026-07-10:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.