Quickstart
Analyze interview audio — per-turn VAD and delivery signals
Analyze a recorded interview (or any call) and get how each turn sounded — valence, arousal, dominance, and delivery signals. For live agent steering, see Integration.
Prerequisites
- A
psk_*API key from the dashboard → Organization → API keys - Node.js 18+
Install
npm install @prosodyai/sdkCreate a client
import { ProsodyClient } from '@prosodyai/sdk';
const client = new ProsodyClient({
apiKey: process.env.PROSODY_API_KEY!,
});Default API origin: https://api.prosodyai.app.
Analyze a file (with turns)
import fs from 'node:fs';
const audio = fs.readFileSync('./interview.wav');
const result = await client.analyze(audio);
console.log(result.valence, result.arousal, result.dominance);
console.log(result.signals);
for (const turn of result.turns ?? []) {
console.log(turn.speaker_id, turn.text, turn.prosody);
}Optional: chunked PCM over REST
createStream() buffers PCM and posts to /v1/analyze/audio on an interval. Useful for offline pipelines — not for live agent sidecars.
const stream = client.createStream({
sampleRate: 16000,
chunkDuration: 3,
onResult: (result) => console.log(result.valence, result.signals),
});
stream.push(pcmFrame);
await stream.flush();Live agent steering uses WebSocket streaming, not chunked batch mode.
Next
- Integration — choose batch vs streaming
- SDK reference — methods and types