Emotion Diarization

Emotion diarization detects and tracks emotions throughout audio segments using AI intelligence. It identifies emotional states like happy, sad, angry, or neutral with precise timing and confidence scores for each segment.

How to Enable

"enable_emotion_diarization": "true"

Request Example

Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests

url = "https://tb2.shunyalabs.ai/v1/transcriptions"
headers = {"X-API-Key": "your-api-key"}

with open("customer_call.wav", "rb") as f:
    files = {"file": f}
    data = {
        "enable_emotion_diarization": "true"
    }

    response = requests.post(
        url,
        headers=headers,
        files=files,
        data=data
    )

print(response.json())

Example Output

{
  "success": true,
  "text": "Thank you so much for your help! I really appreciate it.",
  "segments": [...],
  "emotion_diarization": {
    "status": "success",
    "segments": [
      {
        "start": 0.0,
        "end": 3.5,
        "emotion": "happy",
        "confidence": 0.92
      },
      {
        "start": 3.5,
        "end": 6.8,
        "emotion": "neutral",
        "confidence": 0.85
      }
    ],
    "emotions_detected": ["happy", "neutral"]
  }
}

Use Cases

  • Customer Service: Track emotional journey during support calls and identify escalation points
  • Mental Health: Monitor emotional patterns in therapy or counseling sessions
  • Market Research: Analyze emotional reactions during product testing or focus groups
  • Training & Education: Evaluate emotional engagement in learning sessions
  • Call Quality Analysis: Identify stressful or negative interactions for coaching opportunities
  • User Experience Research: Understand emotional responses to product demonstrations