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 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 we will use to build LiteRT libraries.
cd $WORKSPACE
wget https://github.com/bazelbuild/bazel/releases/download/7.4.1/bazel-7.4.1-installer-linux-x86_64.sh
sudo bash bazel-7.4.1-installer-linux-x86_64.sh
brew install bazel@7
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
brew install --cask android-studio temurin
For easier access and execution of Android NDK tools, add these to the PATH
and set the ANDROID_NDK
variable:
export ANDROID_NDK=$WORKSPACE/android-ndk-r25b/
export PATH=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
export ANDROID_NDK=~/Library/Android/sdk/ndk/27.0.12077973/
export PATH=$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin
export PATH=$PATH:~/Library/Android/sdk/cmdline-tools/latest/bin
Now that your development environment is ready and all pre-requisites installed, you can test the Audio Stable Open model.