Speech emotion detection with a decision model. Turn a voice into labelled plots and plain-language measurements, then let Cloudflare Clef decide how the speaker feels.
Dashboard playing benchmark clips through a virtual microphone; results are clef-flash's real answers.
SpectroMood is an open experiment: can a general-purpose decision model, which was never trained on audio, recognise emotion in speech if we show it the right evidence? Clef reads a short state, up to four images and a typed question, and returns a probability for every allowed answer. We give it a picture of the voice, the speaker's voice measured against their own calm baseline, and a short guide to how emotions sound, then ask: angry, fearful, happy, sad or neutral?
clef-flash with the recommended plots+features+guide setup, 50 clips per language (10 per emotion: angry, fearful, happy, sad, neutral). Chance is 20%.
Arousal AUC measures how well the arousal score separates high-energy speech (angry, fearful, happy) from low-energy speech (sad, neutral): 0.5 is chance, 1.0 perfect. With 50 clips per language the 95% interval on accuracy is roughly ±14 points. Full tables: reports/results.md.
You need Docker and a Cloudflare account. Create an API token with Workers AI permission (dashboard → My Profile → API Tokens → "Workers AI" template).
git clone https://github.com/ketul93/spectromood.git && cd spectromood cp .env.example .env # set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN docker compose up -d --build Open http://localhost:8000:
Browsers only allow the microphone on localhost or over HTTPS. To use it from another device, put the container behind HTTPS (for example a Cloudflare Tunnel); file analysis works over plain HTTP.
Everything runs in the tools container; nothing needs to be installed locally.
docker compose run --rm tools python scripts/prepare_data.py --lang en,it,ru,es docker compose run --rm tools python scripts/evaluate.py --lang en,it,ru,es docker compose run --rm tools pytest The clip lists in data/ / are committed, so every run evaluates the same recordings. Every Clef answer is cached under a hash of the exact request, so a re-run only pays for new requests. Results land in reports/results.md and the figures in docs/images/.
Italian (--lang it) is prepared the same way. Evaluating all four languages makes 800 Clef calls (four setups × 50 clips each), well within one day of the Workers Free allocation.
src/spectromood/ audio prep, features, plots, Clef client, prompts, FastAPI dashboard scripts/ prepare_data.py (download clips), evaluate.py (benchmark + figures) data/ / committed clip lists: manifest.csv, baselines.csv worker/ optional Cloudflare Worker that proxies Clef via the Workers AI binding reports/ benchmark results Datasets and licences The code is Apache-2.0. The audio is not redistributed; prepare_data.py downloads it from the original sources, which keep their own licences:
The example images in docs/images/ are derived from these recordings under the same terms.
Cloudflare for Clef and Workers AI; the authors of RAVDESS, Emozionalmente, RESD, MESD and Rasa; the CAMEO collection for packaging many emotional speech corpora in one place.




