Open 00001101-xt opened 3 years ago
You can use feature_level=opensmile.LowLevelDescriptors
, which will extract low-level descriptors instead of functionals. For opensmile.FeatureSet.eGeMAPSv01b
you will get Nx10
features.
If your goal is to extract functionals on a running window, you can use the arguments starts
and ends
of process_files
or start
and end
of process_signal
. However, you should use a larger window size than 0.025
in this case.
@frankenjoe Can I exctract standalone features like MFCC etc using this script?
We have scripts that extract MFCCs only: https://github.com/audeering/opensmile/tree/master/config/mfcc
Note that you have to adapt them slightly to use with pyopensmile
, see https://audeering.github.io/opensmile-python/usage.html#custom-config
Probably not recommended but you can simply make those parameters configurable by patching FrameModeFunctionals.conf.inc:
# patch opensmile to expose configuration open
file = Path(opensmile.__path__[0]) / "core/config/shared/FrameModeFunctionals.conf.inc"
config_old = file.read_text()
config_new = (
config_old.replace(
"frameMode = full", "frameMode = \\cm[frameMode{full}:frameMode]"
)
.replace("frameSize = 0", "frameSize = \\cm[frameSize{0}:frameSize]")
.replace("frameStep = 0", "frameStep = \\cm[frameStep{0}:frameStep]")
.replace(
"frameCenterSpecial = left",
"frameCenterSpecial = \\cm[frameCenterSpecial{left}:frameCenterSpecial]",
)
)
if config_new != config_old:
file.write_text(config_new)
smile = opensmile.Smile(feature_set=opensmile.FeatureSet.eGeMAPSv01b, feature_level=opensmile.FeatureLevel.Functionals)
The above script gives me features with shape
1x88
, but I want frame-wise features with shapeNx88
, so I changed the above statement to:smile = opensmile.Smile(feature_set=opensmile.FeatureSet.eGeMAPSv01b, feature_level=opensmile.FeatureLevel.Functionals, options={"frameMode": "fixed", "frameSize": 0.025, "frameStep": 0.010})
But it produces
1x88
features still, so I wonder is it possible to extractNx88
features setting theoptions
parameter?Thanks in advance.