Enable speaker diarization with a single parameter. The diarized transcript includes speaker labels on every word, plus pre-computed per-speaker analytics.
import { V100 } from 'v100-sdk';
const v100 = new V100('YOUR_API_KEY');
// Create a meeting with diarization enabled
const session = await v100.meetings.create({
name: 'Product Strategy Review',
transcription: {
enabled: true,
language: 'en',
diarize: true, // Enable speaker diarization
speakerCountHint: 4 // Optional: improve accuracy
}
});
// After meeting ends, get diarized transcript
const transcript = await v100.transcripts.get(session.transcriptId);
// transcript.words = [
// { word: "Let's", start: 1200, end: 1450, speaker: "A" },
// { word: "review", start: 1450, end: 1700, speaker: "A" },
// { word: "I", start: 2100, end: 2200, speaker: "B" },
// { word: "disagree", start: 2200, end: 2600, speaker: "B" },
// ...
// ]
// Name the speakers
await v100.transcripts.nameSpeakers(session.transcriptId, {
'A': 'Sarah Chen',
'B': 'Marcus Johnson',
'C': 'Priya Patel',
'D': 'James Williams'
});
// Get per-speaker analytics
const analytics = await v100.transcripts.speakerAnalytics(session.transcriptId);
// analytics = {
// speakers: [
// { name: "Sarah Chen", talkTimeMs: 420000, talkPercent: 35, turns: 42, questions: 8 },
// { name: "Marcus Johnson", talkTimeMs: 360000, talkPercent: 30, turns: 38, questions: 3 },
// { name: "Priya Patel", talkTimeMs: 240000, talkPercent: 20, turns: 28, questions: 12 },
// { name: "James Williams", talkTimeMs: 180000, talkPercent: 15, turns: 22, questions: 5 }
// ],
// interruptions: 7,
// longestMonologue: { speaker: "Sarah Chen", durationMs: 45000 }
// }