Skip to content

2. General

Theodoros Giannakopoulos edited this page Mar 12, 2020 · 10 revisions

Download

Type the following in your terminal:

git clone https://github.com/tyiannak/pyAudioAnalysis.git

In order to be able to call the pyAudioAnalysis library from any path you need to add the folder that contains it in the ~/.bashrc file. In particular, add a line as the follow in ~/.bashrc:

export PYTHONPATH=$PYTHONPATH:"/home/bla/bla"

(use the exact path where the pyAudioAnalysis folder is contained - without the pyAudioAnalysis name, e.g. if the library is contained in /home/tyiannak/Research/libraries/pyAudioAnalysis, then use /home/tyiannak/Research/libraries in the bashrc file)

Then, you need to update the path details:

 source ~/.bashrc

Dependencies

Below you can find a list of library dependencies, along with the Linux commands to install them.

  • NUMPY
pip install numpy
  • MATPLOTLIB
pip install matplotlib
  • SCIPY
pip install scipy  
  • SKLEARN
pip install sklearn 
  • hmmlearn
pip install hmmlearn
  • Simplejson
pip install simplejson
  • eyeD3
pip install eyed3
  • pydub
pip install pydub

General Library Description

The library code is organized in 6 Python files. In particular:

  • audioAnalysis.py: this file implements the command-line interface of the basic functionalities of the library, along with some recording functionalities.

  • ShortTertFeatures.py: this is where all short-term audio feature extraction is implemented. In total, 21 short-term features are computed, while a mid-term windowing technique is also implemented in another file (see MidTermFeatures.py)

  • MidTermFeatures.py: this is where the mid-term windowing technique is implemented, in order to extract statistics of short-term audio features.

  • audioTrainTest.py: this file implements the audio classification prodecures. It contains functions that can be used to train a Support Vector Machine or k-Nearest-Neighbour classifier. Also, wrapper functions and scripts are provided for general training, evaluating and feature normalization issues.

  • audioSegmentation.py: this file implements audio segmentation functionalities, e.g. fixed-sized segment classification and segmentation, speaker diarization, etc.

  • audioBasicIO.py: this file implements some basic audio IO functionalities as well as file convertions

  • audioVisualization.py: the purpose of this set of functions is to produce user-friendly and representative content visualizations

In the data/ folder, some audio sample files are provided, while in the data/models subfolders you will find some pretrained SVM and kNN models for particular classification tasks (e.g. Speech vs Music, Musical Genre Classification, etc).