exordium.audio.smile¶
OpenSmile feature extractor wrapper.
Classes¶
Extract acoustic features using OpenSmile. |
Module Contents¶
- class exordium.audio.smile.OpensmileWrapper(feature_set: str = 'egemaps', feature_level: str = 'lld')¶
Extract acoustic features using OpenSmile.
Wrapper for OpenSmile feature extraction with support for multiple predefined feature sets and levels.
OpenSmile wrapper class.
- Parameters:
feature_set – Predefined feature set. Supported values are ‘egemaps’ and ‘compare’.
feature_level – Predefined feature level. Supported values are ‘lld’ and ‘functionals’.
- Raises:
ValueError – If feature_set or feature_level is invalid.
- audio_to_feature(audio_path: pathlib.Path | str, **_kwargs) numpy.ndarray¶
Extract OpenSmile features from audio file.
- Parameters:
audio_path – Path to audio file.
**kwargs – Additional arguments (unused, for decorator compatibility).
- Returns:
Feature array from OpenSmile processing.
- __call__(waveform: pathlib.Path | str | numpy.ndarray | torch.Tensor, sr: int = 16000, return_tensors: str = 'npy') numpy.ndarray | torch.Tensor¶
Extract OpenSmile features from waveform or audio file.
- Parameters:
waveform – Path to audio file or audio signal array.
sr – Sample rate in Hz (used if waveform is array).
return_tensors – Return format - “npy” for numpy array, “pt” for torch tensor.
- Returns:
Feature array as numpy array or torch tensor based on return_tensors.