Skip to navigation

Emotion detection

Capture per-emotion confidence scores from Pulse STT responses.
View as Markdown
Pre-Recorded

Enabling emotion detection

Include emotion_detection=true in your Pulse STT query parameters.

Sample request

# Download sample audio (or use your own file)
curl -sL -o audio.wav "https://github.com/smallest-inc/cookbook/raw/main/speech-to-text/getting-started/samples/audio.wav"
curl --request POST \
--url "https://api.smallest.ai/waves/v1/stt/?model=pulse&language=en&emotion_detection=true" \
--header "Authorization: Bearer $SMALLEST_API_KEY" \
--header "Content-Type: audio/wav" \
--data-binary "@audio.wav"

Emotion detection is currently supported only for Pre-Recorded API.

Output format & field of interest

The response adds an emotions object containing floating-point scores (0–1) for happiness, sadness, disgust, fear, and anger. Use these fields to monitor sentiment, trigger QA alerts, or enrich customer analytics.

Sample response

{
"transcription": "Hello world.",
"emotions": {
"happiness": 0.80,
"sadness": 0.15,
"disgust": 0.02,
"fear": 0.03,
"anger": 0.05
}
}