CLI tool
tyiannak/pyAudioAnalysis avatar
tyiannak/pyAudioAnalysis

pyAudioAnalysis is a research library for audio features, classification and segmentation

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

6,271 stars1,213 forksPythonApache-2.0

At a glance

What is it?
pyAudioAnalysis is a Python library from the MagCIL group that extracts features such as MFCCs, spectrograms and chromagrams, trains and evaluates classifiers of audio segments, performs supervised and unsupervised segmentation, and exposes all of it through both a Python API and a command line. It is a research codebase with a permissive licence and a paper behind it, not a polished product.
Who is it for?
Adopt pyAudioAnalysis when you need a working reference implementation of audio classification, segmentation and diarization in Python and you want to read the code as well as call it. Do not adopt it as a production service library, because it is a research codebase that the author recommends learning from through its wiki and articles.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 13 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A research library with a paper behind it

pyAudioAnalysis is a Python library covering a wide range of audio analysis tasks, and it comes from a research group rather than from a product team. It was developed at MagCIL, the Multimodal Analysis Group of the Institute of Informatics and Telecommunications at NCSR Demokritos in Athens, Greece.

The distinction matters for how you read the code. This is a library that grew out of experiments, with the documentation pointing you at three companion articles before it points you at the API, starting with a general introduction to handling audio files from the command line and in Python, then a deeper introduction to recognising sounds with machine learning, and then the library's own wiki.

The methods it implements are described in a publication rather than only in the documentation, and the readme asks you to cite a paper by Theodoros Giannakopoulos in PloS ONE, volume 10, number 12, from 2015, titled pyAudioAnalysis: An Open-Source Python Library for Audio Signal Analysis.

The implementation is Python, the licence is Apache-2.0, the package version in the setup file is 0.3.14, and the last push was on 2026-10-09. The repository has no GitHub releases, so the version history lives in the package index and in the changelog rather than in tags, and there is a CITATION.cff file at the top for the citation tooling.

What the library actually covers

The list of capabilities in the readme is broad enough to be worth taking apart, because it shows that this is a pipeline library rather than a feature extractor with extras.

You can extract audio features and representations, for example MFCCs, spectrograms and chromagrams. You can train, parameter tune and evaluate classifiers of audio segments. You can classify unknown sounds. You can detect audio events and exclude silence periods from long recordings. You can perform supervised segmentation, described as joint segmentation and classification. You can perform unsupervised segmentation, for example speaker diarization, and extract audio thumbnails. You can train and use audio regression models, with emotion recognition as the example application. And you can apply dimensionality reduction to visualise audio data and content similarities.

The last two are the ones that go beyond a typical feature and classify library. Diarization and unsupervised segmentation are the hard problems in audio, and having them in the same library as the features means the segmentation boundaries and the classification share the same feature representation, which is what makes joint supervised segmentation possible at all.

Audio thumbnails and dimensionality reduction are the visualisation side, and the plotting dependencies in the requirements reflect that.

The Python API is a set of high level wrappers

pyAudioAnalysis provides easy-to-call wrappers to execute audio analysis tasks, and the example in the readme shows the whole train then classify loop in two calls.

python
from pyAudioAnalysis import audioTrainTest as aT
aT.extract_features_and_train(["classifierData/music","classifierData/speech"], 1.0, 1.0, aT.shortTermWindow, aT.shortTermStep, "svm", "svmSMtemp", False)
aT.file_classification("data/doremi.wav", "svmSMtemp","svm")

The first call takes a list of folders, where each folder represents a different class, and it extracts the features and trains a classifier on them, saving the model under a name. The second call applies the saved model to an unknown file and returns the class and the scores, and the result shown in the readme is a tuple of the winning score, the array of class probabilities and the class names, in this case music and speech.

The windowing parameters are passed explicitly, using the library's own shortTermWindow and shortTermStep constants, and the classifier is named, here an SVM with a feature scaling method, along with the name of the model file. That is an unusually explicit interface, and it is the right one for a research library, because the feature parameters are the thing you vary between experiments.

The result tuple is worth noting for an integrator, since the raw probability array is returned alongside the label, so a caller can apply its own threshold rather than accepting the argmax.

Everything is on the command line as well

In addition, command-line support is provided for all functionalities, and the example given is the extraction of a spectrogram from a WAV file.

bash
python audioAnalysis.py fileSpectrogram -i data/doremi.wav

The shape of that command is the interface. There is a script, audioAnalysis.py, and a subcommand naming the operation, here fileSpectrogram, followed by options with -i for the input file.

That is a lot of functionality exposed through one dispatcher, and it is the part of the library that makes it usable without writing Python. A user who wants to try a spectrogram or a classifier on a folder of files can do it from a shell, and the readme is clear that the command line covers all of the library's functionality rather than a subset.

For a research group, that is the design that makes a result reproducible. The commands can be pasted into a paper's methods section, and a reader can rerun them, and the same operation is available from Python when the experiment needs to loop over parameters.

Installing it, and what the dependencies pull in

The installation is three steps, and it is the classic clone and install path rather than a wheel.

bash
git clone https://github.com/tyiannak/pyAudioAnalysis.git
pip install -r ./requirements.txt
pip install -e .

The requirements file is what the scientific stack looks like.

There is numpy at 1.20.3 or newer and scipy at 1.6.3 or newer for the numeric work, and scikit-learn at 0.24.2 or newer for the classifiers. hmmlearn at 0.2.5 or newer is there for the hidden Markov model work behind diarization and segmentation, and imblearn is present without a version floor, which is the one unpinned entry in the list.

The rest of the list is about getting audio in and results out. pydub handles audio format conversion and eyeD3 reads and writes ID3 tags from the metadata, so the library can work with tagged media as well as raw WAV files. simplejson and pandas handle data, matplotlib and plotly produce the plots, and tqdm gives progress bars.

The setup file reads the requirements file directly and passes it as install_requires, so the two never drift, and the package data includes the pre-trained models under data/models, with the package declared not zip safe so that those files are usable from an installed copy.

The group around the library is the bigger story

The About MagCIL section explains what the library is a product of, and it is a research group that works on multimodal deep learning for audio, speech, music and video, from fundamental research to deployed systems, and it lists several other tools built the same way.

deep_audio_features trains and uses CNNs for audio classification in PyTorch. deepaudio-x is a PyTorch framework for audio classification. deepaudio-lab is a no-code platform for training, evaluating and deploying audio classifiers. amvoc analyses mouse vocal communication. And paura does real-time audio recording and analysis.

The progression across those five is the point. pyAudioAnalysis is the classical, feature-based approach, and the others are the deep learning and the deployment layer built on top of the same understanding of the domain. Somebody who needs to classify audio in production is likely to end up using the deep learning tools, and pyAudioAnalysis is where the features they replace are implemented and explained.

For an evaluation, that makes the library a reasonable choice for understanding the field and a questionable choice for shipping, and the readme points the same way by sending a newcomer to the introductory articles before the API.

The repository layout and the two test directories

The top level listing is small, and one entry is worth a second look.

There is the pyAudioAnalysis/ package itself, requirements.txt, setup.py, and a README.md with an icon.png. Then there are two test directories, tests/ and pytests/, which is an unusual arrangement, and a .github/ directory with the workflows and a .gitignore.

The duplicated test directory is the kind of thing that happens when a project adds a newer test runner without removing the old one, and it is worth knowing about if you are contributing, because a change that only passes in one of them has not actually been tested. The CITATION.cff file sits at the top alongside the licence and the readme.

The structure of the project is otherwise a normal Python package. The package is declared as a single pyAudioAnalysis package with the model data files attached to it, and the version is taken from the setup file rather than from a separate source of truth, with the requirements read from the file at build time so the install requirements and the development requirements cannot disagree.

Editorial conclusion

Adopt pyAudioAnalysis when you need a working reference implementation of audio classification, segmentation and diarization in Python and you want to read the code as well as call it. Do not adopt it as a production service library, because it is a research codebase that the author recommends learning from through its wiki and articles. Verify first which of the classifiers and feature types you actually need, because the dependency list pulls in a full scientific stack including scikit-learn, hmmlearn and imbalanced-learn, and the pre-trained models shipped in the package are data files rather than a maintained model zoo.

Frequently asked questions

What is pyAudioAnalysis?

It is a Python library from the MagCIL group covering audio feature extraction, classification, segmentation and applications, with support for MFCCs, spectrograms and chromagrams, supervised and unsupervised segmentation including speaker diarization, and audio regression for tasks like emotion recognition.

How do I install pyAudioAnalysis?

Clone the repository, install the dependencies with pip install -r ./requirements.txt, and then install the package itself with pip install -e . The requirements file is read by the setup script and used as install_requires, so the two cannot drift apart.

Can pyAudioAnalysis be used from the command line?

Yes, command-line support is provided for all of the functionality through the audioAnalysis.py script, with a subcommand per operation and options such as -i for the input file, for example python audioAnalysis.py fileSpectrogram -i data/doremi.wav.

Which Python packages does pyAudioAnalysis depend on?

numpy, scipy, scikit-learn, hmmlearn for the hidden Markov model work, imblearn, pydub and eyeD3 for audio and tag handling, simplejson and pandas for data, matplotlib and plotly for plotting, and tqdm for progress.

How does pyAudioAnalysis train a classifier?

Through the audioTrainTest module, where extract_features_and_train takes a list of folders, one per class, along with the windowing parameters and the classifier to use, and file_classification then applies the saved model to an unknown file and returns the label with the class probability array.

Who develops pyAudioAnalysis?

It was developed at MagCIL, the Multimodal Analysis Group of the Institute of Informatics and Telecommunications at NCSR Demokritos in Athens, Greece, by Theodoros Giannakopoulos, whose paper in PloS ONE from 2015 is the citation the readme asks for. The package is Apache-2.0 licensed and at version 0.3.14.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. Project website
  4. README
  5. tyiannak/pyAudioAnalysis on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tyiannak-pyaudioanalysis.svg)](https://hysenlabs.com/projects/tyiannak-pyaudioanalysis)

Was this useful?