Kaldi-native-fbank is a Python library providing a Kaldi-compatible online filter bank (fbank) feature extractor. It is designed to be efficient and has no external native dependencies, aiming for seamless integration across various architectures and operating systems. The library is actively maintained with frequent releases, with the current stable version being 1.22.3.
pip install kaldi-native-fbankVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `OnlineFbank` extractor with `FbankOptions` and process a waveform. Note that `kaldi_native_fbank.OnlineFbank.accept_waveform` expects input samples as a Python list or NumPy array, unlike some other libraries that might accept `torch.Tensor` directly. The example uses `torch.randn` for convenience to generate sample data, which is then converted to a list.
Consult the Kaldi documentation or `kaldi-native-fbank` source for feature computation details. Apply appropriate normalization or transformation if integrating with different feature pipelines.
If `torch` is not installed or desired, convert your audio data to `list` or `numpy.ndarray` (e.g., `your_audio_tensor.numpy().tolist()`) before calling `accept_waveform`.
Ensure the package is installed using `pip install kaldi-native-fbank`. The correct import statement is `import kaldi_native_fbank` or `import kaldi_native_fbank as knf`.
Access nested options through their respective sub-objects. For 'dither', use `opts.frame_opts.dither` instead of `opts.dither`.
Convert `torch.Tensor` input to a Python list or NumPy array before passing it to `accept_waveform`. For example, `your_audio_tensor.numpy().tolist()`.
Adjust the `FbankOptions` parameters (e.g., `opts.mel_opts.high_freq = -400`) to match those used in the training pipeline of the model you are integrating with.