audeering / opensmile-python

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

How to add "emobase2010.conf" to the project #43

Closed srdfjy closed 3 years ago

srdfjy commented 3 years ago

Hi,how to add "emobase2010.conf" to the project, is there a tutorial?

chausner-audeering commented 3 years ago

We have some (admittedly rather limited) documentation on this, see https://audeering.github.io/opensmile-python/usage.html#custom-config.

@frankenjoe As there have been multiple requests regarding how to use other config files with the openSMILE Python wrapper, we'll want to extend the documentation on this aspect. In particular, how to take any of the config files that get shipped with openSMILE and adapt them so they can be used with the wrapper.

frankenjoe commented 3 years ago

how to add "emobase2010.conf" to the project, is there a tutorial?

There is already support for emobase, see https://audeering.github.io/opensmile-python/api-smile.html#featureset

we'll want to extend the documentation on this aspect

It's already covered in the tutorial: https://audeering.github.io/opensmile-python/usage.html#custom-config

EDIT: @chausner-audeering actually suggests to extend the documentation

srdfjy commented 3 years ago

Hi @chausner-audeering @frankenjoe

When I follow the "https://audeering.github.io/opensmile-python/usage.html#custom-config" operation, the following error occurred, I just want to switch from emobase to emobase2010.


import opensmile smile = opensmile.Smile(

feature_set=opensmile.FeatureSet.emobase,

feature_set="emobase2010.conf",
feature_level=opensmile.FeatureLevel.Functionals,

)


Traceback (most recent call last): File "/Users/test/test.py", line 3, in smile = opensmile.Smile( File "/Users/test/venv/lib/python3.9/site-packages/audobject/core/decorator.py", line 109, in wrapper func(self, *args, *kwargs) File "/Users/test/venv/lib/python3.9/site-packages/audeer/core/utils.py", line 174, in new_func return func(args, **kwargs) File "/Users/test/venv/lib/python3.9/site-packages/opensmile/core/smile.py", line 173, in init self._feature_names(), File "/Users/test/venv/lib/python3.9/site-packages/opensmile/core/smile.py", line 333, in _feature_names smile = self._smile(options=options) File "/Users/test/venv/lib/python3.9/site-packages/opensmile/core/smile.py", line 424, in _smile smile.initialize( File "/Users/test/venv/lib/python3.9/site-packages/opensmile/core/SMILEapi.py", line 240, in initialize self._check_smile_result(smileapi.smile_initialize(self._smileobj, File "/Users/test/venv/lib/python3.9/site-packages/opensmile/core/SMILEapi.py", line 478, in _check_smile_result raise OpenSmileException(result) opensmile.core.SMILEapi.OpenSmileException: Code: 6

frankenjoe commented 3 years ago

@srdfjy could you please create a log file and post its content.

srdfjy commented 3 years ago

Hi, @frankenjoe

Below is the configuration file and error log.

code

import opensmile smile = opensmile.Smile(

feature_set=opensmile.FeatureSet.emobase,

feature_set="emobase2010.conf",
feature_level=opensmile.FeatureLevel.Functionals,

)

emobase2010.conf

/////////////////////////////////////////////////////////////////////////////////////// ///////// > openSMILE configuration file for emotion features < ////////////////// ///////// Based on INTERSPEECH 2010 paralinguistics challenge ////////////////// ///////// Pitch, Loudness, Jitter, MFCC, MFB, LSP and functionals ////////////////// ///////// ////////////////// ///////// 1582 1st level functionals: ////////////////// ///////// (34 LLD + 34 delta) 21 functionals ////////////////// ///////// +(4 LLD + 4 delta) 19 functionals ////////////////// ///////// + 1 x Num. pitch onsets (pseudo syllables) ////////////////// ///////// + 1 x turn duration in seconds ////////////////// ///////// ////////////////// ///////// (c) audEERING UG (haftungsbeschr�nkt), ////////////////// ///////// All rights reserved. ////////////////// ///////////////////////////////////////////////////////////////////////////////////////

// // Usage: // SMILExtract -C thisconfig.conf -I input.wav -O output.arff //

/////////////////////////////////////////////////////////////////////////////////////// ; ; 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] ; this line configures the default data memory: instance[dataMemory].type=cDataMemory ;;; wave file input ; instance[waveIn].type=cWaveSource ;;; 40 ms frames features: instance[fr40].type=cFramer instance[w40].type=cWindower instance[fft40].type=cTransformFFT instance[fftmagphase40].type=cFFTmagphase ; SHS Pitch: instance[scale].type=cSpecScale instance[pitchShs].type=cPitchShs instance[pitchSmooth].type=cPitchSmoother instance[pitchJitter].type=cPitchJitter instance[pitchSmooth2].type=cPitchSmoother instance[res].type=cSpecResample

;;; 25 ms frames features: instance[fr25].type=cFramer instance[pe].type=cVectorPreemphasis instance[win].type=cWindower instance[fft].type=cTransformFFT instance[fftmagphase].type=cFFTmagphase ; mfcc instance[mspec].type=cMelspec instance[mfcc].type=cMfcc ; log mel frequency bands (mfb) instance[mspec2].type=cMelspec instance[vo].type=cVectorOperation instance[lpc].type=cLpc ; Line Spectral Frequencies instance[lsp].type=cLsp ; Loudness (narrow-band approximation) instance[intens].type=cIntensity ;;; all LLD concattenated and smoothed using a moving average filter instance[lld].type=cContourSmoother instance[lld2].type=cContourSmoother ; delta coefficients of LLD instance[delta1].type=cDeltaRegression instance[delta2].type=cDeltaRegression ;;; functionals over FULL input (e.g. turns) instance[functL1].type=cFunctionals instance[functL1nz].type=cFunctionals instance[functOnsets].type=cFunctionals ;;; write/append ONE instance to a Weka ARFF file instance[arffsink].type=cArffSink

;; 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) /////////////////////////////////////////////////////////////////////////////////////////////

{\cm[source{?}:include external sources]} ; [waveIn:cWaveSource] ; this sets the level this component writes to ; the level will be created by this component ; no other components may write to a level having the same name ; writer.dmLevel=wave ; this defines a new commandline option "-I" or "-inputfile", which can be used to specify ; the filename on the commandline instead of having it "hard-coded" in the config file ; filename=\cm[inputfile(I){test.wav}:name of input file] ; mix stereo files down to mono for analysis ; monoMixdown=1

[fr40:cFramer] reader.dmLevel=wave writer.dmLevel=frames40 frameSize = 0.060 frameStep = 0.010 frameCenterSpecial = left

[w40:cWindower] reader.dmLevel=frames40 writer.dmLevel=win40frame winFunc = gauss sigma=0.25 gain = 1.0

[fft40:cTransformFFT] reader.dmLevel=win40frame writer.dmLevel=fftc40 ; for compatibility with 2.2.0 and older versions zeroPadSymmetric = 0

[fftmagphase40:cFFTmagphase] reader.dmLevel=fftc40 writer.dmLevel=fftmag40

[scale:cSpecScale] reader.dmLevel=fftmag40 writer.dmLevel=hps scale=log ; octave scale logScaleBase=2

[pitchShs:cPitchShs] reader.dmLevel=hps writer.dmLevel=pitchShs F0raw = 0 voicingClip = 0 voicingC1=0 scores=1 voicing=1 nCandidates=3 octaveCorrection=0

[pitchSmooth:cPitchSmoother] reader.dmLevel=pitchShs writer.dmLevel=pitch F0raw = 0 F0final = 0 F0finalEnv = 1 voicingFinalUnclipped = 1 medianFilter0 = 0 postSmoothingMethod = simple ;simple octaveCorrection = 0 writer.levelconf.nT=10 ;writer.levelconf.noHang=2 writer.levelconf.isRb=0 writer.levelconf.growDyn=1

[pitchSmooth2:cPitchSmoother] reader.dmLevel=pitchShs writer.dmLevel=pitchF F0raw = 0 F0final = 1 F0finalEnv = 0 voicingFinalUnclipped = 0 medianFilter0 = 0 postSmoothingMethod = simple octaveCorrection = 0 writer.levelconf.nT=10 ;writer.levelconf.noHang=2 writer.levelconf.isRb=0 writer.levelconf.growDyn=1

;;;; default (template) configuration section for component 'cPitchJitter' ;;;; [pitchJitter:cPitchJitter] reader.dmLevel = wave writer.dmLevel = jitter // nameAppend = copyInputName = 1 F0reader.dmLevel = pitchF F0field = F0final searchRangeRel = 0.250000 jitterLocal = 1 jitterDDP = 1 jitterLocalEnv = 0 jitterDDPEnv = 0 shimmerLocal = 1 shimmerLocalEnv = 0 onlyVoiced = 0 ;periodLengths = 0 ;periodStarts = 0

[fr25:cFramer] reader.dmLevel=wave writer.dmLevel=frames frameSize = 0.025 frameStep = 0.010 frameCenterSpecial = left

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

[win:cWindower] reader.dmLevel=framespe writer.dmLevel=winframe winFunc = ham gain = 1.0

[fft:cTransformFFT] reader.dmLevel=winframe writer.dmLevel=fftc ; for compatibility with 2.2.0 and older versions zeroPadSymmetric = 0

[fftmagphase:cFFTmagphase] reader.dmLevel=fftc writer.dmLevel=fftmag

[mspec:cMelspec] reader.dmLevel=fftmag writer.dmLevel=mspec1 htkcompatible = 0 usePower = 1 lofreq = 20 hifreq = 8000 nBands=26

[mfcc:cMfcc] reader.dmLevel = mspec1 writer.dmLevel = mfcc htkcompatible = 0 firstMfcc=0 lastMfcc=14 cepLifter=22

[mspec2:cMelspec] reader.dmLevel=fftmag writer.dmLevel=mspec2 htkcompatible = 0 usePower = 1 lofreq = 20 hifreq = 6500 nBands=8

[vo:cVectorOperation] reader.dmLevel=mspec2 writer.dmLevel=mspec2log operation = log copyInputName = 0 nameAppend=logMelFreqBand

[res:cSpecResample] reader.dmLevel=fftc writer.dmLevel=outpR targetFs = 11000

[lpc:cLpc] ;reader.dmLevel=framespe reader.dmLevel=outpR writer.dmLevel=lpc p=8 method = acf saveLPCoeff = 1 lpGain = 0 saveRefCoeff = 0 residual = 0 forwardFilter = 0 lpSpectrum = 0

[lsp:cLsp] reader.dmLevel=lpc writer.dmLevel=lsp

[intens:cIntensity] reader.dmLevel=frames writer.dmLevel=intens intensity=0 loudness=1

[mzcr:cMZcr] reader.dmLevel=frames writer.dmLevel=mzcr zcr=1 amax=0 mcr=0 maxmin=0 dc=0

[lld:cContourSmoother] reader.dmLevel=intens;mfcc;mspec2log;lsp;pitch writer.dmLevel=lld buffersize=1000 writer.levelconf.isRb=0 writer.levelconf.growDyn=1 smaWin = 3 ; this level must grow to hold ALL the LLD of the full input

// ---- delta regression of LLD ---- [delta1:cDeltaRegression] reader.dmLevel=lld writer.dmLevel=lld_de buffersize=1000 writer.levelconf.isRb=0 writer.levelconf.growDyn=1 deltawin=2 blocksize=1

[lld2:cContourSmoother] reader.dmLevel=pitchF;jitter writer.dmLevel=lld2 buffersize=1000 writer.levelconf.isRb=0 writer.levelconf.growDyn=1 ; this level must grow to hold ALL the LLD of the full input

// ---- delta regression of LLD ---- [delta2:cDeltaRegression] reader.dmLevel=lld2 writer.dmLevel=lld2_de buffersize=1000 writer.levelconf.isRb=0 writer.levelconf.growDyn=1 deltawin=2 blocksize=1

[functOnsets:cFunctionals] reader.dmLevel=pitchF writer.dmLevel=functOnsets ; frameSize and frameStep = 0 => functionals over complete input ; (NOTE: buffersize of lld and lld_de levels must be large enough!!) frameMode = full //frameSize = 0 //frameStep = 0 copyInputName=0 functNameAppend=Turn functionalsEnabled=Onset;Times //noPostEOIprocessing = 0 Onset.threshold = 0 ;Onset.thresholdOnset = 0 ;Onset.thresholdOffset = 0 Onset.useAbsVal = 0 Onset.onsetPos = 0 Onset.offsetPos = 0 Onset.numOnsets = 1 Onset.numOffsets = 0 Times.upleveltime25 = 0 Times.downleveltime25 = 0 Times.upleveltime50 = 0 Times.downleveltime50 = 0 Times.upleveltime75 = 0 Times.downleveltime75 = 0 Times.upleveltime90 = 0 Times.downleveltime90 = 0 Times.risetime = 0 Times.falltime = 0 Times.leftctime = 0 Times.rightctime = 0 Times.duration = 1 Times.norm = second

// statistical functionals [functL1:cFunctionals] reader.dmLevel=lld;lld_de writer.dmLevel=func ; frameSize and frameStep = 0 => functionals over complete input ; (NOTE: buffersize of lld and lld_de levels must be large enough!!) frameMode = full frameSize=0 frameStep=0 functionalsEnabled=Extremes;Regression;Moments;Percentiles;Times Extremes.max = 0 Extremes.min = 0 Extremes.range = 0 Extremes.maxpos = 1 Extremes.minpos = 1 Extremes.amean = 1 Extremes.maxameandist=0 Extremes.minameandist=0 Extremes.norm=segment Regression.linregc1 = 1 Regression.linregc2 = 1 Regression.linregerrA = 1 Regression.linregerrQ = 1 Regression.qregc1 = 0 Regression.qregc2 = 0 Regression.qregc3 = 0 Regression.qregerrA = 0 Regression.qregerrQ = 0 Regression.centroid = 0 Regression.doRatioLimit = 0 Regression.centroidRatioLimit = 0 Moments.doRatioLimit = 0 Moments.variance = 0 Moments.stddev = 1 Moments.skewness = 1 Moments.kurtosis = 1 Moments.amean = 0 Percentiles.quartiles = 1 Percentiles.quartile1 = 0 Percentiles.quartile2 = 0 Percentiles.quartile3 = 0 Percentiles.iqr = 1 Percentiles.iqr12 = 0 Percentiles.iqr23 = 0 Percentiles.iqr13 = 0 Percentiles.interp = 1 Percentiles.percentile = 0.01;0.99 Percentiles.pctlrange=0-1 Times.upleveltime25 = 0 Times.downleveltime25 = 0 Times.upleveltime50 = 0 Times.downleveltime50 = 0 Times.upleveltime75 = 1 Times.downleveltime75 = 0 Times.upleveltime90 = 1 Times.downleveltime90 = 0 Times.risetime = 0 Times.falltime = 0 Times.leftctime = 0 Times.rightctime = 0 Times.duration = 0 Times.norm = turn

// statistical functionals [functL1nz:cFunctionals] reader.dmLevel=lld2;lld2_de writer.dmLevel=funcNz ; frameSize and frameStep = 0 => functionals over complete input ; (NOTE: buffersize of lld and lld_de levels must be large enough!!) frameSize=0 frameStep=0 functionalsEnabled=Extremes;Regression;Moments;Percentiles;Times Extremes.max = 0 Extremes.min = 0 Extremes.range = 0 Extremes.maxpos = 1 Extremes.minpos = 1 Extremes.amean = 1 Extremes.maxameandist=0 Extremes.minameandist=0 Extremes.norm = segment Regression.linregc1 = 1 Regression.linregc2 = 1 Regression.linregerrA = 1 Regression.linregerrQ = 1 Regression.qregc1 = 0 Regression.qregc2 = 0 Regression.qregc3 = 0 Regression.qregerrA = 0 Regression.qregerrQ = 0 Regression.centroid = 0 Regression.doRatioLimit = 0 Regression.centroidRatioLimit = 0 Moments.doRatioLimit = 0 Moments.variance = 0 Moments.stddev = 1 Moments.skewness = 1 Moments.kurtosis = 1 Moments.amean = 0 Percentiles.quartiles = 1 Percentiles.quartile1 = 0 Percentiles.quartile2 = 0 Percentiles.quartile3 = 0 Percentiles.iqr = 1 Percentiles.iqr12 = 0 Percentiles.iqr23 = 0 Percentiles.iqr13 = 0 Percentiles.interp = 1 Percentiles.percentile = 0.99 ;Percentiles.pctlrange=0-1 Times.upleveltime25 = 0 Times.downleveltime25 = 0 Times.upleveltime50 = 0 Times.downleveltime50 = 0 Times.upleveltime75 = 1 Times.downleveltime75 = 0 Times.upleveltime90 = 1 Times.downleveltime90 = 0 Times.risetime = 0 Times.falltime = 0 Times.leftctime = 0 Times.rightctime = 0 Times.duration = 0 Times.norm = segment nonZeroFuncts=1

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

// ----- you might need to customise the arff output to suit your needs: ------

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

; [arffsink:cArffSink] ; reader.dmLevel=func;funcNz;functOnsets ; do not print "frameNumber" attribute to ARFF file ; frameIndex=0 ; frameTime=0 ; name of output file as commandline option ; filename=\cm[arffout(O){output.arff}:name of WEKA Arff output file] ; name of @relation in the ARFF file ; relation=\cm[corpus{SMILEfeatures}:corpus name, arff relation] ; name of the current instance (usually file name of input wave file) ; instanceName=\cm[instname(N){noname}:name of arff instance]

; this includes the file 'arff_targets.conf' which configures ; the target classes (ground truths) which are added to the ARFF file ; based on command-line options ; {../shared/arff_targets.conf}

; append to an existing file, so multiple calls of SMILExtract on different ; input files append to the same output ARFF file ; append=1

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

err log

Traceback (most recent call last): File "/Users/opensmile-python/test.py", line 3, in smile = opensmile.Smile( File "/Users/opensmile-python/venv/lib/python3.9/site-packages/audobject/core/decorator.py", line 109, in wrapper func(self, *args, *kwargs) File "/Users/opensmile-python/venv/lib/python3.9/site-packages/audeer/core/utils.py", line 174, in new_func return func(args, **kwargs) File "/Users/opensmile-python/opensmile/core/smile.py", line 173, in init self._feature_names(), File "/Users/opensmile-python/opensmile/core/smile.py", line 333, in _feature_names smile = self._smile(options=options) File "/Users/opensmile-python/opensmile/core/smile.py", line 424, in _smile smile.initialize( File "/Users/opensmile-python/opensmile/core/SMILEapi.py", line 240, in initialize self._check_smile_result(smileapi.smile_initialize(self._smileobj, File "/Users/opensmile-python/opensmile/core/SMILEapi.py", line 478, in _check_smile_result raise OpenSmileException(result) opensmile.core.SMILEapi.OpenSmileException: Code: 7

Process finished with exit code 1

frankenjoe commented 3 years ago

In addition to the stacktrace of Python (which is not really helpful here) you can also log the internal messages of opensmile doing:

smile = opensmile.Smile(
    feature_set='emobase2010.conf',
    feature_level=opensmile.FeatureLevel.Functionals,
    logfile='smile.log',
)

Here is the content of smile.log:

[ 29.09.2021 - 08:08:44 ]
    (MSG) [2] SMILEapi: openSMILE starting!
[ 29.09.2021 - 08:08:44 ]
    (MSG) [2] SMILEapi: config file is: /media/jwagner/Data/Git/pysmile-public/my/emobase2010.conf
[ 29.09.2021 - 08:08:44 ]
    (MSG) [2] cComponentManager: successfully registered 103 component types.
[ 29.09.2021 - 08:08:44 ]
    (ERR) [1] configManager: (line 439) cFileConfigReader::getInstance: missing '=' in line 64 '{\cm[sink{?}:include external sink]}' of instance 'functL1'

So it seems there is something wrong with the configuration file.

frankenjoe commented 3 years ago

It's working after applying the following fixes:

75c75
< instance[arffsink].type=cArffSink
---
> ;instance[arffsink].type=cArffSink
95c95
< {\cm[source{?}:include external sources]}
---
> \{\cm[source{?}:include external sources]}
501c501
< {\cm[sink{?}:include external sink]}
---
> \{\cm[sink{?}:include external sink]}

Here's the full file:

///////////////////////////////////////////////////////////////////////////////////////
///////// > openSMILE configuration file for emotion features < //////////////////
///////// Based on INTERSPEECH 2010 paralinguistics challenge //////////////////
///////// Pitch, Loudness, Jitter, MFCC, MFB, LSP and functionals //////////////////
///////// //////////////////
///////// 1582 1st level functionals: //////////////////
///////// (34 LLD + 34 delta) * 21 functionals //////////////////
///////// +(4 LLD + 4 delta) * 19 functionals //////////////////
///////// + 1 x Num. pitch onsets (pseudo syllables) //////////////////
///////// + 1 x turn duration in seconds //////////////////
///////// //////////////////
///////// (c) audEERING UG (haftungsbeschr�nkt), //////////////////
///////// All rights reserved. //////////////////
///////////////////////////////////////////////////////////////////////////////////////

//
// Usage:
// SMILExtract -C thisconfig.conf -I input.wav -O output.arff
//

///////////////////////////////////////////////////////////////////////////////////////
;
; 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]
; this line configures the default data memory:
instance[dataMemory].type=cDataMemory
;;; wave file input
; instance[waveIn].type=cWaveSource
;;; 40 ms frames features:
instance[fr40].type=cFramer
instance[w40].type=cWindower
instance[fft40].type=cTransformFFT
instance[fftmagphase40].type=cFFTmagphase
; SHS Pitch:
instance[scale].type=cSpecScale
instance[pitchShs].type=cPitchShs
instance[pitchSmooth].type=cPitchSmoother
instance[pitchJitter].type=cPitchJitter
instance[pitchSmooth2].type=cPitchSmoother
instance[res].type=cSpecResample

;;; 25 ms frames features:
instance[fr25].type=cFramer
instance[pe].type=cVectorPreemphasis
instance[win].type=cWindower
instance[fft].type=cTransformFFT
instance[fftmagphase].type=cFFTmagphase
; mfcc
instance[mspec].type=cMelspec
instance[mfcc].type=cMfcc
; log mel frequency bands (mfb)
instance[mspec2].type=cMelspec
instance[vo].type=cVectorOperation
instance[lpc].type=cLpc
; Line Spectral Frequencies
instance[lsp].type=cLsp
; Loudness (narrow-band approximation)
instance[intens].type=cIntensity
;;; all LLD concattenated and smoothed using a moving average filter
instance[lld].type=cContourSmoother
instance[lld2].type=cContourSmoother
; delta coefficients of LLD
instance[delta1].type=cDeltaRegression
instance[delta2].type=cDeltaRegression
;;; functionals over FULL input (e.g. turns)
instance[functL1].type=cFunctionals
instance[functL1nz].type=cFunctionals
instance[functOnsets].type=cFunctionals
;;; write/append ONE instance to a Weka ARFF file
;instance[arffsink].type=cArffSink

;; 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)
/////////////////////////////////////////////////////////////////////////////////////////////

\{\cm[source{?}:include external sources]}
; [waveIn:cWaveSource]
; this sets the level this component writes to
; the level will be created by this component
; no other components may write to a level having the same name
; writer.dmLevel=wave
; this defines a new commandline option "-I" or "-inputfile", which can be used to specify
; the filename on the commandline instead of having it "hard-coded" in the config file
; filename=\cm[inputfile(I){test.wav}:name of input file]
; mix stereo files down to mono for analysis
; monoMixdown=1

[fr40:cFramer]
reader.dmLevel=wave
writer.dmLevel=frames40
frameSize = 0.060
frameStep = 0.010
frameCenterSpecial = left

[w40:cWindower]
reader.dmLevel=frames40
writer.dmLevel=win40frame
winFunc = gauss
sigma=0.25
gain = 1.0

[fft40:cTransformFFT]
reader.dmLevel=win40frame
writer.dmLevel=fftc40
; for compatibility with 2.2.0 and older versions
zeroPadSymmetric = 0

[fftmagphase40:cFFTmagphase]
reader.dmLevel=fftc40
writer.dmLevel=fftmag40

[scale:cSpecScale]
reader.dmLevel=fftmag40
writer.dmLevel=hps
scale=log
; octave scale
logScaleBase=2

[pitchShs:cPitchShs]
reader.dmLevel=hps
writer.dmLevel=pitchShs
F0raw = 0
voicingClip = 0
voicingC1=0
scores=1
voicing=1
nCandidates=3
octaveCorrection=0

[pitchSmooth:cPitchSmoother]
reader.dmLevel=pitchShs
writer.dmLevel=pitch
F0raw = 0
F0final = 0
F0finalEnv = 1
voicingFinalUnclipped = 1
medianFilter0 = 0
postSmoothingMethod = simple
;simple
octaveCorrection = 0
writer.levelconf.nT=10
;writer.levelconf.noHang=2
writer.levelconf.isRb=0
writer.levelconf.growDyn=1

[pitchSmooth2:cPitchSmoother]
reader.dmLevel=pitchShs
writer.dmLevel=pitchF
F0raw = 0
F0final = 1
F0finalEnv = 0
voicingFinalUnclipped = 0
medianFilter0 = 0
postSmoothingMethod = simple
octaveCorrection = 0
writer.levelconf.nT=10
;writer.levelconf.noHang=2
writer.levelconf.isRb=0
writer.levelconf.growDyn=1

;;;; default (template) configuration section for component 'cPitchJitter' ;;;;
[pitchJitter:cPitchJitter]
reader.dmLevel = wave
writer.dmLevel = jitter
// nameAppend =
copyInputName = 1
F0reader.dmLevel = pitchF
F0field = F0final
searchRangeRel = 0.250000
jitterLocal = 1
jitterDDP = 1
jitterLocalEnv = 0
jitterDDPEnv = 0
shimmerLocal = 1
shimmerLocalEnv = 0
onlyVoiced = 0
;periodLengths = 0
;periodStarts = 0

[fr25:cFramer]
reader.dmLevel=wave
writer.dmLevel=frames
frameSize = 0.025
frameStep = 0.010
frameCenterSpecial = left

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

[win:cWindower]
reader.dmLevel=framespe
writer.dmLevel=winframe
winFunc = ham
gain = 1.0

[fft:cTransformFFT]
reader.dmLevel=winframe
writer.dmLevel=fftc
; for compatibility with 2.2.0 and older versions
zeroPadSymmetric = 0

[fftmagphase:cFFTmagphase]
reader.dmLevel=fftc
writer.dmLevel=fftmag

[mspec:cMelspec]
reader.dmLevel=fftmag
writer.dmLevel=mspec1
htkcompatible = 0
usePower = 1
lofreq = 20
hifreq = 8000
nBands=26

[mfcc:cMfcc]
reader.dmLevel = mspec1
writer.dmLevel = mfcc
htkcompatible = 0
firstMfcc=0
lastMfcc=14
cepLifter=22

[mspec2:cMelspec]
reader.dmLevel=fftmag
writer.dmLevel=mspec2
htkcompatible = 0
usePower = 1
lofreq = 20
hifreq = 6500
nBands=8

[vo:cVectorOperation]
reader.dmLevel=mspec2
writer.dmLevel=mspec2log
operation = log
copyInputName = 0
nameAppend=logMelFreqBand

[res:cSpecResample]
reader.dmLevel=fftc
writer.dmLevel=outpR
targetFs = 11000

[lpc:cLpc]
;reader.dmLevel=framespe
reader.dmLevel=outpR
writer.dmLevel=lpc
p=8
method = acf
saveLPCoeff = 1
lpGain = 0
saveRefCoeff = 0
residual = 0
forwardFilter = 0
lpSpectrum = 0

[lsp:cLsp]
reader.dmLevel=lpc
writer.dmLevel=lsp

[intens:cIntensity]
reader.dmLevel=frames
writer.dmLevel=intens
intensity=0
loudness=1

[mzcr:cMZcr]
reader.dmLevel=frames
writer.dmLevel=mzcr
zcr=1
amax=0
mcr=0
maxmin=0
dc=0

[lld:cContourSmoother]
reader.dmLevel=intens;mfcc;mspec2log;lsp;pitch
writer.dmLevel=lld
buffersize=1000
writer.levelconf.isRb=0
writer.levelconf.growDyn=1
smaWin = 3
; this level must grow to hold ALL the LLD of the full input

// ---- delta regression of LLD ----
[delta1:cDeltaRegression]
reader.dmLevel=lld
writer.dmLevel=lld_de
buffersize=1000
writer.levelconf.isRb=0
writer.levelconf.growDyn=1
deltawin=2
blocksize=1

[lld2:cContourSmoother]
reader.dmLevel=pitchF;jitter
writer.dmLevel=lld2
buffersize=1000
writer.levelconf.isRb=0
writer.levelconf.growDyn=1
; this level must grow to hold ALL the LLD of the full input

// ---- delta regression of LLD ----
[delta2:cDeltaRegression]
reader.dmLevel=lld2
writer.dmLevel=lld2_de
buffersize=1000
writer.levelconf.isRb=0
writer.levelconf.growDyn=1
deltawin=2
blocksize=1

[functOnsets:cFunctionals]
reader.dmLevel=pitchF
writer.dmLevel=functOnsets
; frameSize and frameStep = 0 => functionals over complete input
; (NOTE: buffersize of lld and lld_de levels must be large enough!!)
frameMode = full
//frameSize = 0
//frameStep = 0
copyInputName=0
functNameAppend=Turn
functionalsEnabled=Onset;Times
//noPostEOIprocessing = 0
Onset.threshold = 0
;Onset.thresholdOnset = 0
;Onset.thresholdOffset = 0
Onset.useAbsVal = 0
Onset.onsetPos = 0
Onset.offsetPos = 0
Onset.numOnsets = 1
Onset.numOffsets = 0
Times.upleveltime25 = 0
Times.downleveltime25 = 0
Times.upleveltime50 = 0
Times.downleveltime50 = 0
Times.upleveltime75 = 0
Times.downleveltime75 = 0
Times.upleveltime90 = 0
Times.downleveltime90 = 0
Times.risetime = 0
Times.falltime = 0
Times.leftctime = 0
Times.rightctime = 0
Times.duration = 1
Times.norm = second

// statistical functionals
[functL1:cFunctionals]
reader.dmLevel=lld;lld_de
writer.dmLevel=func
; frameSize and frameStep = 0 => functionals over complete input
; (NOTE: buffersize of lld and lld_de levels must be large enough!!)
frameMode = full
frameSize=0
frameStep=0
functionalsEnabled=Extremes;Regression;Moments;Percentiles;Times
Extremes.max = 0
Extremes.min = 0
Extremes.range = 0
Extremes.maxpos = 1
Extremes.minpos = 1
Extremes.amean = 1
Extremes.maxameandist=0
Extremes.minameandist=0
Extremes.norm=segment
Regression.linregc1 = 1
Regression.linregc2 = 1
Regression.linregerrA = 1
Regression.linregerrQ = 1
Regression.qregc1 = 0
Regression.qregc2 = 0
Regression.qregc3 = 0
Regression.qregerrA = 0
Regression.qregerrQ = 0
Regression.centroid = 0
Regression.doRatioLimit = 0
Regression.centroidRatioLimit = 0
Moments.doRatioLimit = 0
Moments.variance = 0
Moments.stddev = 1
Moments.skewness = 1
Moments.kurtosis = 1
Moments.amean = 0
Percentiles.quartiles = 1
Percentiles.quartile1 = 0
Percentiles.quartile2 = 0
Percentiles.quartile3 = 0
Percentiles.iqr = 1
Percentiles.iqr12 = 0
Percentiles.iqr23 = 0
Percentiles.iqr13 = 0
Percentiles.interp = 1
Percentiles.percentile = 0.01;0.99
Percentiles.pctlrange=0-1
Times.upleveltime25 = 0
Times.downleveltime25 = 0
Times.upleveltime50 = 0
Times.downleveltime50 = 0
Times.upleveltime75 = 1
Times.downleveltime75 = 0
Times.upleveltime90 = 1
Times.downleveltime90 = 0
Times.risetime = 0
Times.falltime = 0
Times.leftctime = 0
Times.rightctime = 0
Times.duration = 0
Times.norm = turn

// statistical functionals
[functL1nz:cFunctionals]
reader.dmLevel=lld2;lld2_de
writer.dmLevel=funcNz
; frameSize and frameStep = 0 => functionals over complete input
; (NOTE: buffersize of lld and lld_de levels must be large enough!!)
frameSize=0
frameStep=0
functionalsEnabled=Extremes;Regression;Moments;Percentiles;Times
Extremes.max = 0
Extremes.min = 0
Extremes.range = 0
Extremes.maxpos = 1
Extremes.minpos = 1
Extremes.amean = 1
Extremes.maxameandist=0
Extremes.minameandist=0
Extremes.norm = segment
Regression.linregc1 = 1
Regression.linregc2 = 1
Regression.linregerrA = 1
Regression.linregerrQ = 1
Regression.qregc1 = 0
Regression.qregc2 = 0
Regression.qregc3 = 0
Regression.qregerrA = 0
Regression.qregerrQ = 0
Regression.centroid = 0
Regression.doRatioLimit = 0
Regression.centroidRatioLimit = 0
Moments.doRatioLimit = 0
Moments.variance = 0
Moments.stddev = 1
Moments.skewness = 1
Moments.kurtosis = 1
Moments.amean = 0
Percentiles.quartiles = 1
Percentiles.quartile1 = 0
Percentiles.quartile2 = 0
Percentiles.quartile3 = 0
Percentiles.iqr = 1
Percentiles.iqr12 = 0
Percentiles.iqr23 = 0
Percentiles.iqr13 = 0
Percentiles.interp = 1
Percentiles.percentile = 0.99
;Percentiles.pctlrange=0-1
Times.upleveltime25 = 0
Times.downleveltime25 = 0
Times.upleveltime50 = 0
Times.downleveltime50 = 0
Times.upleveltime75 = 1
Times.downleveltime75 = 0
Times.upleveltime90 = 1
Times.downleveltime90 = 0
Times.risetime = 0
Times.falltime = 0
Times.leftctime = 0
Times.rightctime = 0
Times.duration = 0
Times.norm = segment
nonZeroFuncts=1

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

// ----- you might need to customise the arff output to suit your needs: ------

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

; [arffsink:cArffSink]
; reader.dmLevel=func;funcNz;functOnsets
; do not print "frameNumber" attribute to ARFF file
; frameIndex=0
; frameTime=0
; name of output file as commandline option
; filename=\cm[arffout(O){output.arff}:name of WEKA Arff output file]
; name of @relation in the ARFF file
; relation=\cm[corpus{SMILEfeatures}:corpus name, arff relation]
; name of the current instance (usually file name of input wave file)
; instanceName=\cm[instname(N){noname}:name of arff instance]

; this includes the file 'arff_targets.conf' which configures
; the target classes (ground truths) which are added to the ARFF file
; based on command-line options
; {../shared/arff_targets.conf}

; append to an existing file, so multiple calls of SMILExtract on different
; input files append to the same output ARFF file
; append=1

//////---------------------- END -------------------------///////
srdfjy commented 3 years ago

Thank you so much, it works normally. @frankenjoe

srdfjy commented 3 years ago

@frankenjoe

Hi,Sorry to interrupt you again, I found a problem, the new profile output features only 1428 dimensions, the original one has 1582 dimensions.

frankenjoe commented 3 years ago

The original ARFF sink reads three levels: func;funcNz;functOnsets, so I guess you have to concatenate the three and read from that level.

srdfjy commented 3 years ago

Okay, thanks again! @frankenjoe