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
Code for "Audio-driven Talking Face Video Generation with Learning-based Personalized Head Pose"

Audio-driven Talking Face Video Generation with Learning-based Personalized Head Pose We provide PyTorch implementations for our arxiv paper "Audio-dr

Ran Yi 497 Jan 09, 2023
DeepMusic is an easy to use Spotify like app to manage and listen to your favorites musics.

DeepMusic is an easy to use Spotify like app to manage and listen to your favorites musics. Technically, this project is an Android Client and its ent

Labrak Yanis 1 Jul 12, 2021
Anki vector Music ❤ is the best and only Telegram VC player with playlists, Multi Playback, Channel play and more

Anki Vector Music 🎵 A bot that can play music on Telegram Group and Channel Voice Chats Available on telegram as @Anki Vector Music Features 🔥 Thumb

Damantha Jasinghe 12 Nov 12, 2022
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
Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding

⚠️ Checkout develop branch to see what is coming in pyannote.audio 2.0: a much smaller and cleaner codebase Python-first API (the good old pyannote-au

pyannote 2.1k Dec 31, 2022
DaisyXmusic ❤ 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 34 Oct 22, 2022
LibXtract is a simple, portable, lightweight library of audio feature extraction functions.

LibXtract LibXtract is a simple, portable, lightweight library of audio feature extraction functions. The purpose of the library is to provide a relat

Jamie Bullock 215 Nov 16, 2022
A library for augmenting annotated audio data

muda A library for Musical Data Augmentation. muda package implements annotation-aware musical data augmentation, as described in the muda paper. The

Brian McFee 214 Nov 22, 2022
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
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
Algorithmic and AI MIDI Drums Generator Implementation

Algorithmic and AI MIDI Drums Generator Implementation

Tegridy Code 8 Dec 30, 2022
Okaeri-Music is a telegram music bot project, allow you to play music on voice chat group telegram.

🗄️ PROJECT MUSIC,THIS IS MAINTAINED Okaeri-Music is a telegram bot project that's allow you to play music on telegram voice chat group Features 🔥 Th

Okaeri-Project 2 Dec 23, 2021
A python script that can play .mp3 URLs upon the ringing or motion detection of a Ring doorbell. The sound plays through Sonos speakers.

Ring x Sonos A python script that plays .mp3 files whenever a doorbell is rung or a doorbell detects motion. Features Music! Authors @braden Running T

braden 0 Nov 12, 2021
A collection of free MIDI chords and progressions ready to be used in your DAW, Akai MPC, or Roland MC-707/101

A collection of free MIDI chords and progressions ready to be used in your DAW, Akai MPC, or Roland MC-707/101

921 Jan 05, 2023
BART aids transcribe tasks by taking a source audio file and creating automatic repeated loops, allowing transcribers to listen to fragments multiple times

BART (Beyond Audio Replay Technology) aids transcribe tasks by taking a source audio file and creating automatic repeated loops, allowing transcribers to listen to fragments multiple times (with poss

2 Feb 04, 2022
🎵 Python sound notifications made easy

chime Python sound notifications made easy. Table of contents Table of contents Motivation Installation Basic usage Theming IPython/Jupyter magic Exce

Max Halford 231 Jan 09, 2023
Python interface to the WebRTC Voice Activity Detector

py-webrtcvad This is a python interface to the WebRTC Voice Activity Detector (VAD). It is compatible with Python 2 and Python 3. A VAD classifies a p

John Wiseman 1.5k Dec 22, 2022
ᴀ ʙᴏᴛ ᴛʜᴀᴛ ᴄᴀɴ ᴘʟᴀʏ ᴍᴜꜱɪᴄ ɪɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴏɴ ᴠᴏɪᴄᴇ ᴄᴀʟʟ

GJ516 LOVER'S ııllıllı ♥️ ➤⃝Gᴊ516_ᴍᴜꜱɪᴄ_ʙᴏᴛ ♥️ ıllıllı ᴀ ʙᴏᴛ ᴛʜᴀᴛ ᴄᴀɴ ᴘʟᴀʏ ᴍᴜꜱɪᴄ ɪɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴏɴ ᴠᴏɪᴄᴇ ᴄᴀʟʟ Requirements 📝 FFmpeg NodeJS nodesou

1 Nov 22, 2021
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