Recorded analysis
Analyze a recording for turns, speakers, and acoustics
Send a recording. Get the transcript, who spoke each turn, and how each voice behaved, in one response.
npm install @prosodyai/sdkimport { ProsodyClient } from '@prosodyai/sdk';
const prosody = new ProsodyClient({
apiKey: process.env.PROSODY_API_KEY!,
});
const result = await prosody.transcribe('./call.wav');
for (const turn of result.turns) {
console.log(turn.speaker.label, turn.text, turn.prosody?.state.intonation.pitch);
}What you get back
| Field | Meaning |
|---|---|
text | Full transcript |
turns | speaker, text, startMs, endMs, prosody |
speakers | Each voice with talk time and its measured baseline |
frames | Every measured frame, with state, change, and emotional attributes |
vad | Call-level valence/arousal/dominance, when published |
conversation | Trajectories and deltas |
Diarization and prosody both default on. speaker.id is the stable,
organization-scoped UUID for that voice.
Per turn
turn.prosody?.state.intonation.pitch; // 184.2
turn.prosody?.state.intonation.range; // 4.1
turn.prosody?.state.stress.loudness; // -21.6
turn.prosody?.state.rhythm.voiced; // 0.87
turn.prosody?.state.rhythm.pause; // 0.12
turn.prosody?.change?.stress.loudness; // +3.4 vs this speaker's baselinePer speaker
const [speaker] = result.speakers;
speaker.label; // "Speaker 1"
speaker.talkSeconds; // 142.5
speaker.state.intonation.pitch?.median; // 118.4
speaker.state.stress.loudness?.median;
result.turnsBySpeaker(speaker); // that speaker's turns