Skip to main content

Learn how to enable emotion detection

Include emotion_detection=true in your Lightning STT query parameters. The flag adds lightweight affect analysis without changing how you upload audio.

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 request

curl --request POST \
  --url "https://waves-api.smallest.ai/api/v1/lightning/get_text?model=lightning&language=en&emotion_detection=true" \
  --header "Authorization: Bearer $SMALLEST_API_KEY" \
  --header "Content-Type: audio/wav" \
  --data-binary "@/path/to/audio.wav"

Sample response

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