naxingyu / opensmile

A github repo of the openSMILE feature extraction tool.
http://www.audeering.com/research/opensmile
Other
214 stars 79 forks source link

Python Bindings #8

Open Reichenbachian opened 6 years ago

Reichenbachian commented 6 years ago

I would like to use this application, but I've been struggling with writing python bindings for it. I have functioning code below, but it still uses files instead of memory (which is my end goal for speed purposes). Does anyone have any suggestions? I really think python bindings could give this project even more life. :)

from ctypes import *
los = cdll.LoadLibrary("libopensmile.so") # Import lib
tmp='/home/localhost/Desktop/Projects/Working/Autism/local_cache/AVEC/wav/train/'
args = ['./', '-I', tmp+'train_1.wav', '-O', 'tmp.arff', '-C', '~/Libraries/opensmile/config/ComParE_2016.conf']
arr = (c_char_p * len(args))()
arr[:] = args
los.main(7,arr)
naxingyu commented 6 years ago

Build with PortAudio sh buildWithPortAudio.sh and checkout chapter 2.6 in doc/openSMILE_book.pdf for extracting feature from live audio instead of file.

chausner-audeering commented 3 years ago

The recently released version 3.0 now comes with a low-level SMILEapi Python wrapper and a pip-installable, simpler Python package.