| name | deepgram-core-workflow-b |
| description | Implement real-time streaming transcription with Deepgram WebSocket.
Use when building live transcription, voice interfaces,
real-time captioning, or voice AI applications.
Trigger: "deepgram streaming", "real-time transcription", "live transcription",
"websocket transcription", "voice streaming", "deepgram live".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*), Grep |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","deepgram","voice-ai","transcription","streaming","websocket"] |
| compatibility | Designed for Claude Code |
Deepgram Core Workflow B: Live Streaming Transcription
Overview
Real-time streaming transcription using Deepgram's WebSocket API. The SDK manages the WebSocket connection via listen.live(). Covers microphone capture, interim/final result handling, speaker diarization, UtteranceEnd detection, auto-reconnect, and building an SSE endpoint for browser clients.
Prerequisites
@deepgram/sdk installed, DEEPGRAM_API_KEY configured
- Audio source: microphone (via Sox/
rec), file stream, or WebSocket audio from browser
- For mic capture:
sox installed (apt install sox / brew install sox)
Instructions
Step 1: Basic Live Transcription
import { createClient, LiveTranscriptionEvents } from '@deepgram/sdk';
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
const connection = deepgram.listen.live({
model: 'nova-3',
language: 'en',
smart_format: true,
punctuate: true,
interim_results: true,
utterance_end_ms: 1000,
vad_events: true,
encoding: 'linear16',
sample_rate: 16000,
: ,
});
connection.(., {
.();
});
connection.(., {
.();
});
connection.(., {
.(, err);
});
connection.(., {
transcript = data..[]?.;
(!transcript) ;
(data.) {
.();
} {
process..();
}
});
connection.(., {
.();
});