Interactive demos and examples for the libfmod Rust bindings to FMOD Engine.
Prerequisites: This project expects libfmod to be checked out in a sibling directory (../libfmod) with the FMOD SDK extracted there.
1. Clone libfmod in sibling directory:
# Clone libfmod alongside libfmod-demos
cd ..
git clone https://github.com/chainhackers/libfmod
cd libfmod2. Download and extract FMOD SDK in libfmod directory:
# Download FMOD Studio API from https://www.fmod.com/download
tar -xzf fmodstudioapi20310linux.tar.gz3. Configure library paths for libfmod-demos:
Create .cargo/config.toml in libfmod-demos directory:
[build]
rustflags = [
"-L", "../libfmod/fmodstudioapi20310linux/api/core/lib/x86_64",
"-L", "../libfmod/fmodstudioapi20310linux/api/studio/lib/x86_64",
]4. Download test audio files:
cd ../libfmod-demos
./setup_demos.sh5. Run demos:
# Set FMOD_SDK_DIR for the run script
export FMOD_SDK_DIR=../libfmod/fmodstudioapi20310linux
./run_demos.sh verify_fmod
./run_demos.sh harness_demoverify_fmod- Verify FMOD installation and versionplay_sound <file>- Play audio filesquick_test- Run comprehensive test suite
harness_demo [mode]- Non-interactive feature demonstrationsspatial- 3D spatial audio with moving sourceexplosion- One-shot event playbackparameters/rpm- Real-time parameter controlfootsteps- Multiple simultaneous eventsall- Run all demos (default)
interactive_harness- Real-time keyboard-controlled testing1-6- Play/stop eventsWASD/QE- Move sound source in 3DSpace- Stop all eventsH- Toggle help
studio_banks_test- Bank loading and managementstudio_events_test- Event playback and variationsstudio_parameters_test- Parameter automation
# Basic verification
./run_demos.sh verify_fmod
# Play downloaded audio
./run_demos.sh play_sound assets/audio/bird.ogg
# 3D spatial demo
./run_demos.sh harness_demo spatial
# Interactive control
./run_demos.sh interactive_harness- Rust 1.79+ (2024 edition)
- FMOD Engine SDK 2.03.09+
- Linux/macOS (Windows support planned)
libfmod-demos/
├── src/lib.rs # Common utilities
├── examples/ # Demo implementations
├── assets/audio/ # Downloaded test files
├── setup_demos.sh # Audio file downloader
└── run_demos.sh # Demo runner script
MIT