AudioFeatureGenerator Python Wrapper

This is a C++ Python wrapper that allows for executing the ReRAM Engine AudioFeatureGenerator component from a Python script.

This is useful as it allows for using the exact same spectrogram generation algorithms between the Python model training scripts and embedded device at runtime.

This wrapper is made accessible to a Python script via the AudioFeatureGenerator python API. This Python API loads the C++ Python wrapper shared library into the Python runtime.

Refer to the AudioFeatureGenerator documentation for more details

Source Code

  • Python wrapper - This makes the AudioFeatureGenerator C++ library accessible to Python

  • C++ library - The C++ library, this invokes the Microfrontend to generate spectrograms

  • Microfrontend - Google-provided audio processing library to generate spectrograms

  • Python API - Python package that loads this C++ wrapper

Building the Wrapper

Pre-built

This wrapper comes pre-built when installing the YZLITE Python package, e.g.:

pip install yizhu-yzlite

Automatic Build

This wrapper is automatically built when installing from source, e.g.:

git clone https://github.com/ReRAM-Labs/yzlite.git
cd yzlite
pip install -e .

Manual build via YZLITE command

To manually build this wrapper, issue the YZLITE command:

yzlite build audio_feature_generator_wrapper

Manual build via CMake

This wrapper can also be built via CMake using Visual Studio Code or the Command Line.

To build the wrapper, the build_options.cmake file needs to be modified.

Create the file <yzlite repo root>/user_options.cmake and add:

yzlite_set(YZLITE_TARGET yzlite_audio_feature_generator_wrapper)

Note

You must remove this option and clean the build directory before building the example applications

Then configure the CMake project using the Window/Linux GCC toolchain and build the target: yzlite_audio_feature_generator_wrapper.