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
This is a python package that turns any images into MIDI files that views the same as them

image_to_midi This is a python package that turns any images into MIDI files that views the same as them. This package firstly convert the image to AS

Rainbow Dreamer 4 Mar 10, 2022
Guide & Examples to create deeplearning gstreamer plugins and use them in your pipeline

upai-gst-dl-plugins Guide & Examples to create deeplearning gstreamer plugins and use them in your pipeline Introduction Thanks to the work done by @j

UPAI.IO 11 Dec 11, 2022
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
Music player - endlessly plays your music

Music player First, if you wonder about what is supposed to be a music player or what makes a music player different from a simple media player, read

Albert Zeyer 482 Dec 19, 2022
A tool for retrieving audio in the past

Rewinder A tool for retrieving audio in the past. Ever felt like, I need to remember that discussion which happened 10 min back. Now you can! Rewind a

Bharat 1 Jan 24, 2022
Code for csig audio deepfake detection

FMFCC Audio Deepfake Detection Solution This repo provides an solution for the 多媒体伪造取证大赛. Our solution achieve the 1st in the Audio Deepfake Detection

BokingChen 9 Jun 04, 2022
We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

1 Nov 19, 2021
The official repository for Audio ALBERT

AALBERT Here is also the official repository of AALBERT, which is Pytorch lightning reimplementation of the paper, Audio ALBERT: A Lite Bert for Self-

pohan 55 Dec 11, 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
DCL - An easy to use diacritic library used for diacritic and accent manipulation.

Diacritics Library This library is used for adding, and removing diacritics from strings. Getting started Start by importing the module: import dcl DC

Kreus Amredes 6 Jun 03, 2022
The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases.

The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases. The cross-section of the throat is less than the cross-section of the inlet pi

Shankar Mahadevan L 1 Dec 03, 2021
An AI for Music Generation

An AI for Music Generation

Hao-Wen Dong 1.3k Dec 31, 2022
This Is Telegram Music UserBot To Play Music Without Being Admin

This Is Telegram Music UserBot To Play Music Without Being Admin

Krishna Kumar 36 Sep 13, 2022
Library for working with sound files of the format: .ogg, .mp3, .wav

Library for working with sound files of the format: .ogg, .mp3, .wav. By work is meant - playing sound files in a straight line and in the background, obtaining information about the sound file (auth

Romanin 2 Dec 15, 2022
Audio features extraction

Yaafe Yet Another Audio Feature Extractor Build status Branch master : Branch dev : Anaconda : Install Conda Yaafe can be easily install with conda. T

Yaafe 231 Dec 26, 2022
Telegram Voice-Chat Bot Written In Python Using Pyrogram.

Telegram Voice-Chat Bot Telegram Voice-Chat Bot To Play Music From Various Sources In Your Group Support All linux based os. Windows Mac Diagram Requi

TheHamkerCat 314 Dec 29, 2022
The project aims to develop a personal-assistant for Windows & Linux-based systems

The project aims to develop a personal-assistant for Windows & Linux-based systems. Samiksha draws its inspiration from virtual assistants like Cortana for Windows, and Siri for iOS. It has been desi

SHUBHANSHU RAI 1 Jan 16, 2022
Muzic: Music Understanding and Generation with Artificial Intelligence

Muzic is a research project on AI music that empowers music understanding and generation with deep learning and artificial intelligence.

Microsoft 2.6k Dec 30, 2022
Any-to-any voice conversion using synthetic specific-speaker speeches as intermedium features

MediumVC MediumVC is an utterance-level method towards any-to-any VC. Before that, we propose SingleVC to perform A2O tasks(Xi → Ŷi) , Xi means utter

谷下雨 47 Dec 25, 2022
Anaphones are like anagrams, but for sounds.

Anaphones Anaphones are like anagrams but for sounds (phonemes). Examples include: salami-awesomely, atari-tiara, and beefy-phoebe. Anaphones can be a

James Murphy 18 Nov 02, 2022