audeering / opensmile-python

Python package for openSMILE
https://audeering.github.io/opensmile-python/
Other
243 stars 32 forks source link

How to adopt old MFCC12_0_D_A.conf to opensmile-python? #61

Closed sucv closed 2 years ago

sucv commented 2 years ago

I changed the conf according to what I can learn from the existing issues. I received the following error:

[ 13.08.2022 - 12:03:08 ]
    (MSG) [2] SMILEapi: openSMILE starting!
[ 13.08.2022 - 12:03:08 ]
    (MSG) [2] SMILEapi: config file is: /home/zhangsu/phd4/load/opensmile_mfcc.conf
[ 13.08.2022 - 12:03:08 ]
    (MSG) [2] cComponentManager: successfully registered 97 component types.
[ 13.08.2022 - 12:03:08 ]
    (ERR) [0] commandlineParser: parse: unknown option '-bufferModeRbConf' on commandline!
[ 13.08.2022 - 12:03:08 ]
    (ERR) [0] commandlineParser: parse: unknown option '-frameModeFunctionalsConf' on commandline!
[ 13.08.2022 - 12:03:08 ]
    (ERR) [1] dataMemory: level 'func' was not found! component 'extsink.reader' requires it for reading.
     it seems that no dataWriter has registered this level! check your config!
[ 13.08.2022 - 12:03:08 ]
    (ERR) [1] dataMemory: there were unresolved read-requests, please check your config file for missing components / missing dataWriters or incorrect level names (typos, etc.)!

Below are the changed conf


///////////////////////////////////////////////////////////////////////////////////////
///////// > openSMILE configuration file to extract MFCC features <  //////////////////
/////////   HTK target kind: MFCC_0_D_A, numCeps=12                  //////////////////
/////////                                                            //////////////////
///////// (c) 2013-2016 audEERING.                                   //////////////////
/////////     All rights reserved. See file COPYING for details.    //////////////////
///////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////
;
; This section is always required in openSMILE configuration files
;   it configures the componentManager and gives a list of all components which are to be loaded
; The order in which the components are listed should match
;   the order of the data flow for most efficient processing
;
///////////////////////////////////////////////////////////////////////////////////////
[componentInstances:cComponentManager]
instance[dataMemory].type=cDataMemory

\{\cm[source{?}:include external source]}

[componentInstances:cComponentManager]
 ; audio framer
instance[frame].type=cFramer
 ; speech pre-emphasis (on a per frame basis as HTK does it)
instance[pe].type=cVectorPreemphasis
 ; apply a window function to pre-emphasised frames
instance[win].type=cWindower
 ; transform to the frequency domain using FFT
instance[fft].type=cTransformFFT
 ; compute magnitude of the complex fft from the previous component
instance[fftmag].type=cFFTmagphase
 ; compute Mel-bands from magnitude spectrum
instance[melspec].type=cMelspec
 ; compute MFCC from Mel-band spectrum
instance[mfcc].type=cMfcc
 ; compute delta coefficients from mfcc and energy
instance[delta].type=cDeltaRegression
 ; compute acceleration coefficients from delta coefficients of mfcc and energy
instance[accel].type=cDeltaRegression

; run single threaded (nThreads=1)
; NOTE: a single thread is more efficient for processing small files, since multi-threaded processing involves more
;       overhead during startup, which will make the system slower in the end
nThreads=1
; do not show any internal dataMemory level settings
; (if you want to see them set the value to 1, 2, 3, or 4, depending on the amount of detail you wish)
printLevelStats=0

/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////   component configuration  ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
; the following sections configure the components listed above
; a help on configuration parameters can be obtained with
;  SMILExtract -H
; or
;  SMILExtract -H configTypeName (= componentTypeName)
/////////////////////////////////////////////////////////////////////////////////////////////

[frame:cFramer]
reader.dmLevel=wave
writer.dmLevel=frames
noPostEOIprocessing = 1
copyInputName = 1
frameSize = 0.0250
frameStep = 0.010
frameMode = fixed
frameCenterSpecial = left

[pe:cVectorPreemphasis]
reader.dmLevel=frames
writer.dmLevel=framespe
k = 0.97
de = 0

[win:cWindower]
reader.dmLevel=framespe
writer.dmLevel=winframes
copyInputName = 1
processArrayFields = 1
 ; hamming window
winFunc = ham
 ; no gain, no offset
gain = 1.0
offset = 0

[fft:cTransformFFT]
reader.dmLevel=winframes
writer.dmLevel=fft
copyInputName = 1
processArrayFields = 1
inverse = 0
 ; for compatibility with 2.2.0 and older versions
zeroPadSymmetric = 0

[fftmag:cFFTmagphase]
reader.dmLevel=fft
writer.dmLevel=fftmag
copyInputName = 1
processArrayFields = 1
inverse = 0
magnitude = 1
phase = 0

[melspec:cMelspec]
reader.dmLevel=fftmag
writer.dmLevel=melspec
copyInputName = 1
processArrayFields = 1
; htk compatible sample value scaling
htkcompatible = 1
nBands = 26
; use power spectrum instead of magnitude spectrum
usePower = 1
lofreq = 0
hifreq = 8000
specScale = mel
inverse = 0

[mfcc:cMfcc]
reader.dmLevel=melspec
writer.dmLevel=ft0
copyInputName = 1
processArrayFields = 1
firstMfcc = 0
lastMfcc  = 12
cepLifter = 22.0
htkcompatible = 1

[delta:cDeltaRegression]
reader.dmLevel=ft0
writer.dmLevel=ft0de
nameAppend = de
copyInputName = 1
noPostEOIprocessing = 0
deltawin=2
blocksize=1

[accel:cDeltaRegression]
reader.dmLevel=ft0de
writer.dmLevel=ft0dede
nameAppend = de
copyInputName = 1
noPostEOIprocessing = 0
deltawin=2
blocksize=1

  //////////////////////////////////////////////////////////////////////
 ///////////////////  data output configuration  //////////////////////
//////////////////////////////////////////////////////////////////////

[componentInstances:cComponentManager]
instance[audspec_lldconcat].type=cVectorConcat

[audspec_lldconcat:cVectorConcat]
reader.dmLevel = ft0;ft0de;ft0dede
writer.dmLevel = lld
includeSingleElementFields = 1

\{\cm[sink{?}:include external sink]}

//////---------------------- END -------------------------///////

Thanks for your help in advance!!