Audio features extraction

Related tags

AudioYaafe
Overview

Yaafe

Yet Another Audio Feature Extractor

Build status

  • Branch master : travis_master
  • Branch dev : travis_dev
  • Anaconda : anaconda_build

Install

Conda

conda

Yaafe can be easily install with conda. To install this package with conda run:

conda install -c conda-forge yaafe

Docker

docker

Yaafe can also be install through Docker.

Get the official Yaafe image from Yaafe repository on Docker Hub:

docker pull yaafe/yaafe
docker tag yaafe yaafe/yaafe

or build it from the sources directory:

docker build --tag=yaafe .

Following both of the method above, you then have a docker image tagged as yaafe. The yaafe command is the entrypoint for that docker image so you can run 'yaafe' from the command line through docker run yaafe. For example:

docker run -it yaafe --help
docker run -it yaafe --volume=$(pwd):/wd  --workdir=/wd -c resources/featureplan -r 16000 --resample resources/yaafe_check.wav

On Linux, it can be usefull to create an alias for it:

alias yaafe='docker run -it --rm=true --volume=$(pwd):/wd  --workdir=/wd yaafe'

You could then simply run:

yaafe --help
yaafe -l

et voilà !

If you need to set the docker user as the current user on the host, you could try to run docker with the -u $(id -u):$(id -g) option

docker run -it --rm=true --volume=$(pwd):/wd  --workdir=/wd -u $(id -u):$(id -g) yaafe -c resources/featureplan -o h5 -r 16000 --resample resources/yaafe_check.wav

Last but not least, the entry-point for the yaafe docker image is smart :

  • every command that start with a dash - will be pass as options to the yaafe command inside the docker container

  • every command that does not start with a dash will be treated as a regular command. For example:

    docker run -it yaafe /bin/bash
    

will give you access to a bash terminal inside the docker. And

docker run -it yaafe yaafe-engine --help

will launch the ``yaafe-engine` batch processing tool.

From sources

Yaafe source code should compile on linux and MacOsX platform, and uses CMake as compilation tool. Yaafe requires third-party libraries to enable specific features. Some of these libraries may already be available on your system.

The argtable library is required.

The eigen library is also required. You could either installed it through your regular packages manager (e.g. libeigen3-dev on Debian) and then pass the -DWITH_EIGEN_LIBRARY=ON option flag to ccmake. Or you can use the source code provided through the git submodule included in the Yaafe git repository and which you can get with the git submodule update --init command. If you used ``git clone --recursive`` to clone Yaafe, you don't need this.

Depending on optional features you want to use, other librairies may be used:

  • libsndfile: enable reading WAV files format (highly recommanded)
  • libmpg123: enable reading MP3 audio files
  • HDF5 >= 1.8: enable H5 output format
  • liblapack: enable some audio features (LSF)
  • FFTW3: use FFTW instead of Eigen for FFT computations (pay attention to licensing issues when linking with the GPL FFTW3 library).

To use the yaafe script you need Python >= 2.5, and the numpy package.

Once previous libraries are installed (some may have been locally installed in <lib-path>), you can compile with the following steps:

mkdir build
cd build
ccmake -DCMAKE_PREFIX_PATH=<lib-path> -DCMAKE_INSTALL_PREFIX=<install-path> ..
make
make install

If you use an external eigen library (and not the one provided by git submodule), don't forget to add the flag:

ccmake -DCMAKE_PREFIX_PATH=<lib-path> -DCMAKE_INSTALL_PREFIX=<install-path> -DWITH_EIGEN_LIBRARY=ON ..
Several options can control Yaafe compilation. More details can be found at:
http://yaafe.sourceforge.net/manual/install.html

Environment

To easily use Yaafe, you should set the following environment vars:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEST_DIR/lib

On MacOSX replace LD_LIBRARY_PATH by DYLD_FALLBACK_LIBRARY_PATH

The output of make install should give you the INSTALL_DIR path (defaults to /usr/local). The python files are installed in /usr/local/lib/python2.7/site-packages, which is not by default in the python path on MacOSX. The consequence is the error ERROR: cannot load yaafe packages: No module named yaafelib. There are 3 ways to solve this problem :

  • The simplest way is to add the line sys.path.append("/usr/local/lib/python2.7/site-packages") in /usr/local/bin/yaafe after from optparse import OptionParser, but it won't let you use the yaafelib unless you add this line (and import sys) before each import of yaafelib.
  • You can use export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH or add it to your ~/.bash_profile, but this will affect other versions of python.
  • You can move the files to a site-package folder that is in your PYTHONPATH:
    • if you use Python 2: mv /usr/local/lib/python2.7/site-packages/yaafefeatures.py /usr/local/lib/python2.7/site-packages/yaafelib `python -c 'import sys, re ; print next(i for i in sys.path if re.match(".*site-packages$", i))'
    • if you use Python 3: mv /usr/local/lib/python2.7/site-packages/yaafefeatures.py /usr/local/lib/python2.7/site-packages/yaafelib `python3 -c 'import sys, re ; print(next(i for i in sys.path if re.match(".*site-packages$", i)))'

If you use Matlab, you can set your MATLABPATH var:

export MATLABPATH=$MATLABPATH:$DEST_DIR/matlab

Documentation

Documentation is also available online: http://yaafe.github.io/Yaafe/ (mirror: http://yaafe.sourceforge.net/)

To build documentation, you need Sphinx. Before building documentation, you should set your environment correctly so that sphinx builds documentation with automatic features documentation.

To build documentation, just run make doc_python in the build directory. Documentation is built in doc/doc_python/html.

License

YAAFE is released under the version 3 of the GNU Lesser General Public License. Read COPYING and COPYING.LESSER for more details. The user should also read DISCLAIMER before linking with optional libraries which have different license policy.

Support

To get help with YAAFE, use the mailing-list [email protected] (registration at https://lists.sourceforge.net/lists/listinfo/yaafe-users ).

Credits

Yaafe was first developed at Telecom Paristech / AAO Team. It uses several great open-source projects like Eigen, Smarc, libsndfile, mpg123, HDF5.

If you want to cite Yaafe in a publication, please see CITATION.

Comments
  • Python 3

    Python 3

    Hi, I started from the version #21 by @AbdealiJK, made some minor changes for pathes, and added a cast to make the extensions work.

    The command yaafe works with all the features I tested with both python 2 and 3 installations.

    The interface should work since I think it is used by the command. I'll test the block per block extraction next week.

    opened by louisabraham 21
  • feat: add Python 3 support and get ready for conda-forge

    feat: add Python 3 support and get ready for conda-forge

    This pull request starts from @louisabraham and @AbdealiJK work.

    • fixes #41 in order to get ready for a later conda-forge automated build
    • fixes py3 str/bytes bug (see commit 5353880313067923da60a38efb12b2c46746b35b)
    opened by hbredin 12
  • conda-forge packages

    conda-forge packages

    This issue is meant to keep track of my work on conda-forge packages.

    • [x] mpg123
      • Code: https://github.com/hbredin/staged-recipes/tree/master
      • Pull request: https://github.com/conda-forge/staged-recipes/pull/2685
    • [x] libsndfile:
      • Code: https://github.com/hbredin/staged-recipes/tree/feature/libsndfile
      • Pull request: https://github.com/conda-forge/staged-recipes/pull/2689
    • [x] argtable2
      • Code: https://github.com/hbredin/staged-recipes/tree/feature/argtable2
      • Pull request: https://github.com/conda-forge/staged-recipes/pull/2688
    • [x] yaafe
      • Code: https://github.com/hbredin/staged-recipes/tree/feature/yaafe
      • Pull request: https://github.com/conda-forge/staged-recipes/pull/2709
      • ~~For now, it is based on my own fork of Yaafe (https://github.com/hbredin/staged-recipes/blob/feature/yaafe/recipes/yaafe/meta.yaml#L15).~~
      • ~~A new release of Yaafe with Py3 support and that fixes #41 is still missing.~~
    • [ ] Windows support
      • For now, all these packages are Linux and macOS only.
    enhancement 
    opened by hbredin 9
  • fix some memleaks; time_start, time_limit for yaafe-io; pickling for Dataflow; misc

    fix some memleaks; time_start, time_limit for yaafe-io; pickling for Dataflow; misc

    I apologize that you may find it a little bit hard to review the PR as too many files are changed in https://github.com/mckelvin/Yaafe/commit/a4c37503d0ecd84d72b4a2ecc2ab9da24bf6c667 and https://github.com/mckelvin/Yaafe/commit/4ba7c408141da8ae9773e2eca304330115cd2cdb, may be commit-by-commit review is a better choice. I'm not sure whether all the commits are welcomed, and if not so, please comment in the thread without any hesitating.

    here are the main changes:

    • fix memleaks in:
      • Smarc
      • MP3FileReader
      • freeOutputFormatDescription
    • support time_start, time_limit for MP3FileReader and AudioFileReader so that we can extract features in a specific time range.
    • src_cpp: DataFlow: support stringify, loads
    • src_python: Dataflow: support pickling

    this PR should also fix #3

    opened by mckelvin 8
  • core::Engine: Fix memory leaks, misc

    core::Engine: Fix memory leaks, misc

    this PR consists of 2 parts;

    1. fix compilation error while compiling using llvm(clang++ ) as reference to 'end' is ambiguous in llvm.
    2. fix memory leaks in core::Engine, the following code may be useful to prove that the memory leak do exists while reload DataFlow again and again:
    import resource
    from yaafelib import Engine, FeaturePlan
    
    def main():
        fp = FeaturePlan()
        fp.addFeature("mfcc: MFCC blockSize=1024 stepSize=1024 CepsNbCoeffs=11")
        df = fp.getDataFlow()
    
        for i in range(10):
            for j in range(100):
                eng = Engine()
                eng.load(df)
            print i, resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
    
    if __name__ == '__main__':
        main()
    
    

    the output is something like:

    0 19640
    1 22808
    2 25712
    3 28616
    4 31784
    5 34688
    6 37592
    7 40760
    8 43664
    9 46568
    

    if no memory leaks happened, it should be something like:

    0 19640
    1 19640
    2 19640
    ...
    

    I've check and test the code. Please review it again!

    BTW, I use the great tool valgrind to find the leak code.

    opened by mckelvin 7
  • Sample rate has no default value

    Sample rate has no default value

    When I use yaafe -f "cqt: CQT" KR.mp3 for example, I get the error "ERROR: please specify sample rate !" though the file has a sample rate (I can see it in its metadata), and the help (yaafe -h) specifies : -r SAMPLE_RATE, --rate=SAMPLE_RATE working samplerate in Hz. If not set, use input file sample rate.

    If I add the parameter yaafe -r 44100 -f "cqt: CQT" KR.mp3, it just works fine.

    opened by louisabraham 6
  • Build error with HDF5

    Build error with HDF5

    Hi,

    I'm trying to compile with macOS Sierra. With the option WITH_HDF5=ON, I get the following error :

    /Users/louisabraham/Downloads/yaafe-v0.65/src_cpp/yaafe-python/yaafecoreH5.cpp:69:56: error: 'H5P_DEFAULT' was not declared in this scope
         hid_t h5file = H5Fopen(h5filename, H5F_ACC_RDONLY, H5P_DEFAULT);
    

    I used the command : cmake -DWITH_FFTW3=ON -DWITH_HDF5=ON -DWITH_LAPACK=ON -DWITH_MPG123=ON configure .. And it found HDF5. -- Found HDF5: /opt/local/lib/libhdf5.dylib

    When I try without HDF5 (cmake -DWITH_FFTW3=ON -DWITH_HDF5=OFF -DWITH_LAPACK=ON -DWITH_MPG123=ON configure ..), it works fine !

    opened by louisabraham 6
  • Update the documentation

    Update the documentation

    The documentation should be update to reflect the merge of the former TP Yaafe Extension. The TP Yaafe extension features (including CQT and Chroma) should be added to the list of yaafe core feauture

    opened by thomasfillon 6
  • Cmake Issue

    Cmake Issue

    Hey- I am getting this error when I try to ccmake yaafe. Any help?

    CMake Error at src_cpp/yaafe-core/CMakeLists.txt:24 (add_library):
      Cannot find source file:   /Users/rees/Yaafe/externals/fmemopen/fmemopen.c
     Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
      .hxx .in .txx
    
    
    CMake Error: CMake can not determine linker language for target: yaafe-core
    CMake Error in src_cpp/yaafe-core/CMakeLists.txt:
      Exporting the target "yaafe-core" is not allowed since its linker language
      cannot be determined
    
    opened by relliottsmith 4
  • Windows native compilation, minor fixes

    Windows native compilation, minor fixes

    I compiled Yaafe on a Windows system using CMake and MinGW. I fixed some minor runtime and compilation issues along the way and documented everything in a tutorial: https://crococode.wordpress.com/2015/04/01/compiling-yaafe-on-windows-using-cmake-and-mingw/

    opened by Crococode 4
  • os x install using hp5

    os x install using hp5

    Hi, if I configure an install WITH_HDF5 I get the following error (and 4 more similar) with make:

    /yaafe/src_cpp/yaafe-python/yaafecoreH5.cpp:69:56: error: use of undeclared identifier  'H5P_DEFAULT'
    hid_t h5file = H5Fopen(h5filename, H5F_ACC_RDONLY, H5P_DEFAULT);
    

    H5P_DEFAULT is defined in "H5Ppublic.h" so, by including this file in "yaafe-python/yaafecoreH5.cpp" :

    #ifdef WITH_HDF5
    #include "H5Fpublic.h"
    #include "H5Gpublic.h"
    #include "H5Opublic.h"
    #include "H5Dpublic.h"
    #include "H5Ppublic.h"
    #include "H5PTpublic.h"
    #include "H5LTpublic.h"
    #include "H5Tpublic.h"
    #include "H5Apublic.h"
    #endif
    

    the problem goes away. The question is, is this the proper solution? many thanks Dave Greenwood

    opened by davegreenwood 4
  • Easier way to install yaafe?

    Easier way to install yaafe?

    Hi, Python novice here. I'm trying to figure out how to use yaafe in Linux.

    • One option is to install it using "Conda", which points to "Anaconda" which points to "Miniconda" which doesn't have any command line install as far as I can see, I don't have a GUI on Linux. It also pointed to another application called "fish" for "silent installation" but at so many levels down I just gave up.

    • Then I see you can build it from scratch - but if this is Python, an interpreted language, why does anything have to be compiled?

    • Isn't there just a pip installer (it's the default package manager that comes with Python) or python files I can download? I don't see why this Conda/docker/cmake thing is necessary. I just want to use this .py library :(

    Thanks.

    opened by RichardJECooke 1
  • How to supress console output in yaafelib?

    How to supress console output in yaafelib?

    Hello,

    I would like to supress console output when processing audio files. I always get messages like: "process file SOME_FILE done in 0.000296s"

    Is there a way to get rid of these messages?

    Thank you

    opened by bastian-f 0
  • Docker version asks for python3

    Docker version asks for python3

    I have tried the docker build of Yaafe, but I get the following error (both in the image downloaded from Dockerhub and in the image built from the Dockerfile):

    ~> docker run -it yaafe --help /usr/bin/env: python3: No such file or directory

    I think there is also a typo in the README:

    docker tag yaafe yaafe/yaafe

    should be

    docker tag yaafe/yaafe yaafe

    Best.

    opened by helma 4
  • Segmentation Fault with Derivate" on some files">

    Segmentation Fault with "TemporalShapeStatistics > Derivate" on some files

    Hallo!

    I get crashes when computing the derivative of a TemporalShapeStatistics feature on some rare input audio files (all tested with latest Yaafe master branch, on Ubuntu).

    How to reproduce the crash:

    from yaafelib import *
    
    # Link to the example audiofile:
    # https://www.dropbox.com/s/0ypcwyhp8exzq1z/crash-yaafe-derivative-16k.wav?dl=0
    audiofile = "crash-yaafe-derivative-16k.wav" 
    
    fp = FeaturePlan(sample_rate=16000)
    fp.addFeature('tempshape_d1: TemporalShapeStatistics blockSize=1024 stepSize=512 > Derivate DOrder=1')
    df = fp.getDataFlow()
    engine = Engine()
    engine.load(df)
    
    
    afp = AudioFileProcessor()
    afp.processFile(engine, audiofile)
    feats = engine.readAllOutputs()
    

    The segmentation fault happens in Yaafe/src_cpp/yaafe-core/ComponentHelpers.h, line 189:

          while (!in->empty())
          {
            const double* inPtr = in->readToken();  // <- here it crashes !!!!!!
            double* outPtr = out->writeToken();
            for (int i=0;i<m_size;i++)
            {
                ...
    

    I tried to fix the problem, but I am not really sure how to not interfere with the underlying algorithm. It would be highly appreciated, if anyone has some tips how to fix that - please let me know if I can help in any way!

    Thanks a lot, LG Georg

    opened by gholzmann 6
  • Can not open libyaafe-python.so

    Can not open libyaafe-python.so

    OSError: libyaafe-python.so: cannot open shared object file: No such file or directory I don't know why this happen.Everything is good when I was installing this.But I can not import yaafelib.Thanks a lot for your help.

    opened by MXuer 0
Releases(0.70)
  • 0.70(Mar 29, 2017)

    This is a major release incorporating many bug fixes from contributors.

    It also merge the former Telecom Paristech Yaafe extension including many great audio features into Yaafe. Last but not least it adds Python 3 support to Yaafe.

    Source code(tar.gz)
    Source code(zip)
Owner
Yaafe
Yaafe
A2DP agent for promiscuous/permissive audio sinc.

Promiscuous Bluetooth audio sinc A2DP agent for promiscuous/permissive audio sinc for Linux. Once installed, a Bluetooth client, such as a smart phone

Jasper Aorangi 4 May 27, 2022
A bot that can play music on Telegram Group and Channel Voice Chats

DaisyXmusic ❤ is the best and only Telegram VC player with playlists, Multi Playback, Channel play and more

TeamOfDaisyX 20 Jun 11, 2021
Python library for handling audio datasets.

AUDIOMATE Audiomate is a library for easy access to audio datasets. It provides the datastructures for accessing/loading different datasets in a gener

Matthias 121 Nov 27, 2022
Library for Python 3 to communicate with the Google Chromecast.

pychromecast Library for Python 3.6+ to communicate with the Google Chromecast. It currently supports: Auto discovering connected Chromecasts on the n

Home Assistant Libraries 2.4k Jan 02, 2023
pedalboard is a Python library for adding effects to audio.

pedalboard is a Python library for adding effects to audio. It supports a number of common audio effects out of the box, and also allows the use of VST3® and Audio Unit plugin formats for third-party

Spotify 3.9k Jan 02, 2023
spafe: Simplified Python Audio-Features Extraction

spafe aims to simplify features extractions from mono audio files. The library can extract of the following features: BFCC, LFCC, LPC, LPCC, MFCC, IMFCC, MSRCC, NGCC, PNCC, PSRCC, PLP, RPLP, Frequenc

Ayoub Malek 310 Jan 01, 2023
Jarvis From Basic to Advance - make a voice assistant similar to JARVIS (in iron man movie)

JARVIS (Basic to Advance) This was my attempt to make a voice assistant similar to JARVIS (in iron man movie) Let's be honest, it's not as intelligent

codesempai 17 Dec 25, 2022
Audio2midi - Automatic Audio-to-symbolic Arrangement

Automatic Audio-to-symbolic Arrangement This is the repository of the project "A

Ziyu Wang 24 Dec 05, 2022
A rofi-blocks script that searches youtube and plays the selected audio on mpv.

rofi-ytm A rofi-blocks script that searches youtube and plays the selected audio on mpv. To use the script, run the following command rofi -modi block

Cliford 26 Dec 21, 2022
Small Python application that links a Digico console and Reaper, handling automatic marker insertion and tracking.

Digico-Reaper-Link This is a small GUI based helper application designed to help with using Digico's Copy Audio function with a Reaper DAW used for re

Justin Stasiw 10 Oct 24, 2022
Spotifyd - An open source Spotify client running as a UNIX daemon.

Spotifyd An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and sup

8.5k Jan 09, 2023
Music generation using ml / dl

Data analysis Document here the project: deep_music Description: Project Description Data Source: Type of analysis: Please document the project the be

0 Jul 03, 2022
Code for paper 'Audio-Driven Emotional Video Portraits'.

Audio-Driven Emotional Video Portraits [CVPR2021] Xinya Ji, Zhou Hang, Kaisiyuan Wang, Wayne Wu, Chen Change Loy, Xun Cao, Feng Xu [Project] [Paper] G

197 Dec 31, 2022
Conferencing Speech Challenge

ConferencingSpeech 2021 challenge This repository contains the datasets list and scripts required for the ConferencingSpeech challenge. For more detai

73 Nov 29, 2022
Open-Source bot to play songs in your Telegram's Group Voice Chat. Powered by @Akki_ThePro

VcPlayer Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜ Account requirements A Telegram account to use as the music bot, You cannot use regular

Akki ThePro 2 Dec 25, 2021
voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country

covid19-voice-assistant voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country installi

Miguel 2 Dec 05, 2021
Spotify Song Recommendation Program

Spotify-Song-Recommendation-Program Made by Esra Nur Özüm Written in Python The aim of this project was to build a recommendation system that recommen

esra nur özüm 1 Jun 30, 2022
A python program to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks.

I'm writing a python script to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks called ReCut. So far there are two

Dönerspiess 1 Oct 27, 2021
An audio-solving python funcaptcha solving module

funcapsolver funcapsolver is a funcaptcha audio-solving module, which allows captchas to be interacted with and solved with the use of google's speech

Acier 8 Nov 21, 2022
Stevan KZ 1 Oct 27, 2021