Playing with sam-audio
audio-playground is a research environment for experimenting with Meta's SAM-Audio model. Due to specific hardware and compiler requirements on M1/M2/M3 Macs, this project uses Conda to manage C++ dependencies (FFmpeg) and PyTorch Nightly builds to ensure compatibility.
The best way of running this is is as a subfolder of a conda project, as described in this blog post
Because this project relies on local patches for Meta's research repos, the setup must be done in a specific order:
git clone https://github.com/gotofritz/audio-playground.git
cd audio-playground
conda create -n sam-audio python=3.12 -y
conda activate sam-audio
# install the env variables
./setup_conda_env_variables.sh
conda activate sam-audio
# Install project-specific FFmpeg
conda install -c conda-forge ffmpeg=7.1 -y
# Install Nightly PyTorch & TorchCodec (Critical for M1/M2/M3)
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall
pip install --pre torchcodec --index-url https://download.pytorch.org/whl/nightly/cpu
sam-audio and perception-models available locally.# Install research modules
pip install git+https://github.com/facebookresearch/ImageBind.git
pip install av --no-binary av
# Install this project in editable mode
pip install -e . --no-deps
audio-playground provides a CLI to run audio separation tasks:
# Show available commands
audio-playground --help
# Run the separation test suite
audio-playground test-run
Example usage:
β― audio-playground test-run
2025-12-24 18:28:24 [INFO] Starting...
2025-12-24 18:28:24 [INFO] Using mps device
...
2025-12-24 18:28:30 [INFO] Done. Results saved to ./wav/processed/
Install pre-commit hooks:
pre-commit install
Run the test suite:
task test
Check code quality:
task qa
audio-playground/
βββ audio_playground/ # Main package
β βββ cli/ # CLI commands and entry points
β βββ config/ # Pydantic-settings configuration
β βββ ... # Logic modules
βββ tests/ # Test suite
βββ pyproject.toml # Build system & metadata
βββ README.md # This file
# Run tests
task test
# Linting and Type checking
task qa
# Set environment vars
./setup_conda_env_variables.sh
conda deactivate
conda activate sam-audio
# refresh the CLI tool
pip install --no-deps --no-cache-dir .
The project uses pytest. Ensure your environment is active:
pytest tests/
This project is licensed under the MIT License - see the LICENSE file for details.
18 commits
Python
98.5%
Shell
1.5%
Playing with sam-audio
audio-playground is a research environment for experimenting with Meta's SAM-Audio model. Due to specific hardware and compiler requirements on M1/M2/M3 Macs, this project uses Conda to manage C++ dependencies (FFmpeg) and PyTorch Nightly builds to ensure compatibility.
The best way of running this is is as a subfolder of a conda project, as described in this blog post
Because this project relies on local patches for Meta's research repos, the setup must be done in a specific order:
git clone https://github.com/gotofritz/audio-playground.git
cd audio-playground
conda create -n sam-audio python=3.12 -y
conda activate sam-audio
# install the env variables
./setup_conda_env_variables.sh
conda activate sam-audio
# Install project-specific FFmpeg
conda install -c conda-forge ffmpeg=7.1 -y
# Install Nightly PyTorch & TorchCodec (Critical for M1/M2/M3)
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall
pip install --pre torchcodec --index-url https://download.pytorch.org/whl/nightly/cpu
sam-audio and perception-models available locally.# Install research modules
pip install git+https://github.com/facebookresearch/ImageBind.git
pip install av --no-binary av
# Install this project in editable mode
pip install -e . --no-deps
audio-playground provides a CLI to run audio separation tasks:
# Show available commands
audio-playground --help
# Run the separation test suite
audio-playground test-run
Example usage:
β― audio-playground test-run
2025-12-24 18:28:24 [INFO] Starting...
2025-12-24 18:28:24 [INFO] Using mps device
...
2025-12-24 18:28:30 [INFO] Done. Results saved to ./wav/processed/
Install pre-commit hooks:
pre-commit install
Run the test suite:
task test
Check code quality:
task qa
audio-playground/
βββ audio_playground/ # Main package
β βββ cli/ # CLI commands and entry points
β βββ config/ # Pydantic-settings configuration
β βββ ... # Logic modules
βββ tests/ # Test suite
βββ pyproject.toml # Build system & metadata
βββ README.md # This file
# Run tests
task test
# Linting and Type checking
task qa
# Set environment vars
./setup_conda_env_variables.sh
conda deactivate
conda activate sam-audio
# refresh the CLI tool
pip install --no-deps --no-cache-dir .
The project uses pytest. Ensure your environment is active:
pytest tests/
This project is licensed under the MIT License - see the LICENSE file for details.
18 commits
Python
98.5%
Shell
1.5%