gemini-live-audio-transcriber
Skill2 starsChanged 29 days agoApache-2.0View on GitHub
Streams bidirectional low-latency audio via WebSocket/WebRTC to the Gemini Live API, handling Opus framing, Voice Activity Detection (VAD), live turn interruptions, and real-time pair-programming transcription. Use when building voice coding interfaces, real-time audio agents, or conversational telemetry.
In this repository108 other files it gives its agents.
- AGENTS.mdAGENTS.md
- everything-gemini-maintainerSkill
- adversarial-fuzz-generatorSkill
- agent-evalsSkill
- ai-first-engineeringSkill
- alloydb-omni-vectorSkill
- apache-kafka-streamsSkill
- api-craftsmanSkill
- architecture-designerSkill
- argon-3d-game-engineSkill
- argon-3d-scene-architectSkill
- argon-procedural-asset-generatorSkill
- argon-visual-critique-loopSkill
- argo-workflowsSkill
- autonomous-incident-healerSkill
- axum-web-serviceSkill
- bigquery-vector-searchSkill
- browser-qa-testerSkill
- chromadb-vector-storeSkill
- cilium-ebpf-networkingSkill
- clickhouse-analyticsSkill
- cloud-deploy-canarySkill
- cloudflare-r2-object-storageSkill
- cloudflare-workersSkill
- cloud-run-agentsSkill
- context-cachingSkill
- context-distillation-compressorSkill
- context-warmerSkill
- continuous-learningSkill
- cost-oracle-finopsSkill
- cross-repo-swarm-syncSkill
- cve-remediation-orchestratorSkill
- database-architectSkill
- dataproc-spark-analyticsSkill
- dbt-transformationSkill
- debezium-cdcSkill
- devops-pipelineSkill
- distributed-rate-limitingSkill
- docker-compose-orchestratorSkill
- duckdb-local-olapSkill
- dynamic-thinking-allocationSkill
- ebpf-microvm-sandboxSkill
- ebpf-sandbox-enforcerSkill
- elephant-goldfish-modelSkill
- envoy-ai-gatewaySkill
- ephemeral-swarm-orchestratorSkill
- fastapi-productionSkill
- fullstack-nextjsSkill
- game-audio-synthesizerSkill
- game-studioSkill
- gemini-function-callingSkill
- gemini-groundingSkill
- gemini-live-multimodalSkill
- gemini-live-screen-visionSkill
- gemini-multimodalSkill
- genetic-prompt-cross-pollinatorSkill
- git-craftsmanSkill
- github-opsSkill
- google-axSkill
- google-flow-orchestratorSkill
- The first 60 shown.
The file
Files
Gemini Live Audio Transcriber & Speech Duplex (gemini-live-audio-transcriber)
This skill provides an enterprise client and server implementation for streaming bidirectional audio with Gemini Live API (WebSocket & WebRTC), providing sub-150ms speech-to-text (STT) and text-to-speech (TTS) pair-programming loops.
🎙️ Streaming Audio Pipeline Architecture
graph LR
Microphone[Microphone Input 16kHz PCM] --> OpusEncoder[Opus Frame Encoder 20ms chunks]
OpusEncoder --> WS[WebSocket / WebRTC Live Duplex]
WS --> Gemini[Gemini Live API Session]
Gemini -->|Server Audio Chunks| Speaker[Speaker Output 24kHz PCM]
Gemini -->|Interruption Signal| VAD[VAD / Barge-In Gate]
VAD -->|Truncate Buffer| WS⚙️ Connection & Protocol Specification
WebSocket Handshake Configuration
{
"setup": {
"model": "models/gemini-2.0-flash-exp",
"generation_config": {
"response_modalities": ["AUDIO", "TEXT"],
"speech_config": {
"voice_config": {
"prebuilt_voice_config": {
"voice_name": "Aoede"
}
}
}
},
"system_instruction": {
"parts": [{ "text": "You are Antigravity Pair Programmer. Speak concisely, direct errors accurately, and interrupt when syntax fails." }]
}
}
}💻 Node.js Low-Latency Audio Streaming Loop
import WebSocket from 'ws';
export class GeminiLiveAudioClient {
constructor(apiKey, host = 'generativelanguage.googleapis.com') {
this.wsUrl = `wss://${host}/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key=${apiKey}`;
this.ws = null;
}
connect() {
this.ws = new WebSocket(this.wsUrl);
this.ws.on('open', () => this.sendInitialSetup());
this.ws.on('message', (data) => this.handleIncomingMessage(data));
}
sendInitialSetup() {
const setupMsg = {
setup: {
model: 'models/gemini-2.0-flash-exp',
generation_config: { response_modalities: ['AUDIO', 'TEXT'] }
}
};
this.ws.send(JSON.stringify(setupMsg));
}
sendAudioChunk(pcmChunkBuffer) {
const base64Audio = pcmChunkBuffer.toString('base64');
const realtimeInput = {
realtime_input: {
media_chunks: [
{
mime_type: 'audio/pcm;rate=16000',
data: base64Audio
}
]
}
};
this.ws.send(JSON.stringify(realtimeInput));
}
handleIncomingMessage(raw) {
const msg = JSON.parse(raw);
if (msg.serverContent?.interrupted) {
console.log('⚡ Barge-in detected: User interrupted AI playback');
this.flushAudioBuffers();
}
}
flushAudioBuffers() {
// Clear playback buffer instantly
}
}🚀 Key Operational Invariants
- Sample Rate Standardization: Mic input MUST be 16,000 Hz single-channel PCM; model audio response is 24,000 Hz PCM.
- 20ms Frame Chunking: Send audio chunks every 20ms (320 samples / 640 bytes) to maintain sub-200ms latency.
- Barge-In Handling: Listen for
serverContent.interrupted: trueand instantly discard pending playback frames.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

