In this Learning Path, you’ll learn how to convert the Stable Audio Open Small model to the LiteRT (.tflite) format, then build a simple test program to generate audio on a mobile device.
Your first task is to prepare a development environment with the required software:
Create a separate directory for all the dependencies and repositories that this Learning Path uses.
Export the WORKSPACE
variable to point to this directory, which you will use in the following steps:
mkdir my-workspace
export WORKSPACE=$PWD/my-workspace
Download and install Python version 3.10 using the following commands:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-pip
brew install python@3.10
brew link python@3.10 --force
You can verify the installation and check the version with:
python3.10 --version
CMake is an open-source tool that automates the build process for software projects, helping to generate platform-specific build configurations.
sudo apt update
sudo apt install cmake
brew install cmake
You can verify the installation and check the version with:
cmake --version
See the CMake install guide for troubleshooting instructions.
Bazel is an open-source build tool which you will use to build LiteRT libraries.
cd $WORKSPACE
export BAZEL_VERSION=7.4.1
wget https://github.com/bazelbuild/bazel/releases/download/{$BAZEL_VERSION}/bazel-{$BAZEL_VERSION}-installer-linux-x86_64.sh
sudo bash bazel-7.4.1-installer-linux-x86_64.sh
export PATH="/usr/local/bin:$PATH"
cd $WORKSPACE
export BAZEL_VERSION=7.4.1
curl -fLO "https://github.com/bazelbuild/bazel/releases/download/{$BAZEL_VERSION}/bazel-{$BAZEL_VERSION}-installer-darwin-arm64.sh"
sudo bash bazel-7.4.1-installer-darwin-arm64.sh
export PATH="/usr/local/bin:$PATH"
You can verify the installation and check the version with:
bazel --version
To run the model on Android, install Android Native Development Kit (Android NDK):
cd $WORKSPACE
wget https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
unzip android-ndk-r25b-linux.zip
cd $WORKSPACE
wget https://dl.google.com/android/repository/android-ndk-r25b-darwin.zip
unzip android-ndk-r25b-darwin.zip
For easier access and execution of Android NDK tools, add these to the PATH
and set the NDK_PATH
variable:
export NDK_PATH=$WORKSPACE/android-ndk-r25b/
export ANDROID_NDK_HOME=$NDK_PATH
export PATH=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
export NDK_PATH=$WORKSPACE/android-ndk-r25b/
export ANDROID_NDK_HOME=$NDK_PATH
export PATH=$NDK_PATH/toolchains/llvm/prebuilt/darwin-x86_64/bin/:$PATH
Now that your development environment is ready and all the prerequisites are installed, you can move on to test the Stable Audio Open Small model.