Urgent.News

What's breaking now, across thousands of outlets.

Tech

Speech Emotion Recognition

From Speech to Emotion Labels: Inside a Speech Recognition Speech carries more than words. Changes in pitch, energy, rhythm, and tone can give listeners clues about how an utterance sounds emotionally. The Speech Emotion Recognition project explores how machine learning can identify those patterns in audio and assign an emotion label. Try the product: tonelabb.vercel.app The project is built…

Speech carries more than just words. The way it sounds, with changes in pitch, energy, rhythm, and tone, can give listeners hints about how an utterance feels emotionally. This is the focus of the Speech Emotion Recognition project, which uses machine learning to spot these patterns in audio and give it a label describing the emotion.

The project relies on a dataset called RAVDESS, which contains acted speech recordings expressing different emotions. There are six possible labels: neutral, happy, sad, angry, fearful, and disgust. Since the speakers are acting, the system's output should be seen as a prediction based on the patterns in this dataset, rather than a reliable reading of a person's true emotional state.

Before a model can classify an audio clip, it needs to be prepared. The audio is converted into a consistent form, with mono, resampling to 22,050 Hz, trimming of silence, and adjustment to three seconds. Normalization of the waveform is also done. Two types of audio features are prepared: Mel-frequency cepstral coefficients (MFCCs) and a log-mel spectrogram.

MFCCs use 40 coefficients, each with a time-based mean and standard deviation, creating an 80-value feature vector. The spectrogram shows how sound energy changes over time across frequency bands, and is turned into a 128-by-128 image for a convolutional neural network.

Several modeling approaches are compared. For the MFCC training, a support vector machine, a random forest, and an XGBoost classifier are evaluated on validation and test data. The best model is chosen using validation macro-F1, which measures performance across all classes. A separate workflow trains a convolutional neural network on the log-mel spectrograms, using validation accuracy to guide learning-rate adjustments and early stopping.

The CNN is saved as its own model. The API currently uses the MFCC pipeline, while the CNN training workflow is available in the repository but not loaded or served by the API.

To ensure the evaluation is speaker-independent, the data loader assigns each actor's recordings to one of three splits: training, validation, or test. Each of these splits is 15% of the data. This helps reduce the chance that the same person's voice appears in both training and evaluation data, making the evaluation more meaningful.

The API provides an HTTP endpoint for audio classification, accepting WAV, MP3, FLAC, OGG, and M4A files up to 20 MB. It gives the predicted label, top three class probabilities, clip duration, and a disclaimer. The endpoint also has health and interactive API documentation.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

HauntedShell: When Your Local Terminal Starts Whispering Back at Midnight

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine * What I Built For this week's Ghost in the Machine challenge, I wanted to build something that bridges…

  • HauntedShell merges nostalgic coding with local AI capabilities.
  • Runs DistilGPT2 model locally on CPU or GPU for privacy and cost.
  • Uses ASCII art, colored text, typewriter effect for retro AI interface.

Why We Built BalochDev the Way We Did

From a small idea in Balochistan to a remote-first software and AI studio building products for the world. In 2024, I started BalochDev because I was tired of seeing talent from our region treated as…

  • BalochDev founded in 2024 to address underrepresentation of Baloch talent.
  • Utilizes AI tools like Claude Code to enhance engineering workflow.
  • Completed over 80 projects for international clients across five continents.

Pricing Rule Rollouts: A Failure-Containment Plan for Node.js Error Tracking

Pricing Rule Rollouts: A Failure-Containment Plan for Node.js Error Tracking The least complex safe choice is to treat an uncaught exception as a process-fatal event: record the error synchronously…

  • Uncaught exceptions treated as process-fatal events
  • Capture error details, initiate controlled error handling
  • Preserve request-level validation, business errors, metadata

More from Wednesday 28 October →