Emotion from labeled audio#
Fit a linear Choice family on your own recordings, then classify a new clip.
The reader embeds the sound; group_id keeps each speaker together during
cross-validation. Audio support is experimental.
From the repository root:
python -m pip install -e '.[embedding]'
venn download-embedder
python examples/audio/emotion.py --labels /path/to/clips.csv --clip /path/to/new.wav
The first run also downloads the Venn head. The reader runs on CPU and caches each clip's vector. Clips must be mono 16 kHz WAV, at most 30 seconds and 6 MB. The example does not resample or download recordings.
Create a CSV with these columns; paths are relative to the CSV:
path,label,speaker
recordings/a-angry-01.wav,angry,speaker-a
recordings/b-happy-01.wav,happy,speaker-b
Supply at least five distinct clips per label, at least two labels, and several speakers represented across labels. The two rows above show the format; add your remaining recordings before running. Keep the prediction clip out of the CSV.
The script prints JSON with the fitting clip count, cross-validation accuracy
and the new clip's answer and probabilities. It saves the family under
VENN_HOME, so later applications can reload it. See the
linear-family cookbook
for its request shape and the comparison guide
for the CREMA-D example.