Skip to navigation

Expression Measurement API

Measure emotional expression in voices and faces, from uploaded audio and images or live audio and video streams.

Measure emotional expression in speech and faces, from recordings you already have or from live audio and video. The audio endpoints score each window of speech, and the video endpoints score the faces in each image or video frame. You can use them to:

  • Label a dataset of recorded speech or images
  • Evaluate generated audio, such as text-to-speech output
  • Route or monitor a live call while it is still going

What it measures

From speech, the API returns expressions such as amusement and vocal qualities such as monotone. From an image, it returns expressions and visible facial actions, such as smile, for the largest faces it detects, 2 by default.

ModalityInputOutput
AudioSpeech audioFor each window of speech, expressions and voice_attributes scores, out of 413 and 190 names.
VideoImages or video frames containing facesFor each face, its bounding box. For the largest faces, 2 by default, expressions and descriptions scores, out of 48 and 27 names.

Learn more about the science behind expression measurement in Hume’s research and publications.

Endpoints

Upload endpoints measure media you already have, and realtime endpoints measure media as it streams. For the same media, both return the same measurements. Every endpoint is served from api.cloud.hume.ai, the upload endpoints over https:// and the realtime endpoints over wss://, with your API key in the X-Hume-Api-Key header (see Authentication).

EndpointUse it forRequest
Audio uploadA recorded audio file, such as a call recording in a datasetPOST /v1/expression/audio/file
Audio realtimeLive audio, such as a microphone or a call in progressWSS /v1/expression/audio/realtime
Image uploadOne or more JPEG images, such as the images in a datasetPOST /v1/expression/video/file
Video realtimeLive video sent as JPEG frames, such as a camera feedWSS /v1/expression/video/realtime

The realtime endpoints share one WebSocket protocol, described in Sessions. Each upload request and realtime session is also recorded as a run, which you can look up later for its status and configuration. Runs do not store measurements, so keep the results you need.

Compatibility

The API version is the path prefix, /v1/. Within a version:

  1. The server may add fields to the responses and messages it sends. Ignore fields you do not recognize.
  2. New prediction names may be added. Treat a name you do not recognize as a new prediction, not as an error.
  3. Requests and messages the client sends are validated strictly. An unrecognized field in a config part or a session.update is rejected with config_invalid.

Next steps