| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Command-line interface for engine-sim audio generation.
This tool allows you to generate high-quality engine audio from command line with real-time playback, WAV export, and professional-grade audio quality.
| Platform | Status | Audio Backend |
|---|---|---|
| macOS | ✅ Production | CoreAudio / AudioUnit |
| iOS | ✅ Done | AVAudioEngine (see escli-ios/) |
| ESP32 | 🔧 In Progress | I2S via MAX98357A (see engine-sim-esp32/) |
| Android | 🔧 Planned | IAudioHardwareProvider stub ready |
| Linux | ❌ Not supported | No audio provider; build blocked |
| Windows | ❌ Not supported | No audio provider; build blocked |
WAV export works on all platforms regardless of audio hardware support.
# Clone the repository (includes engine-sim-bridge submodule)
git clone --recursive https://github.com/danieljsinclair/engine-sim-cli.git
cd engine-sim-cli
# Build the application
make
# Run with default engine (real-time playback)
./build/engine-sim-cli --default-engine --rpm 2000 --play
# Run with sine wave test
./build/engine-sim-cli --sine --rpm 2000 --play
# Export audio to WAV file
./build/engine-sim-cli --default-engine --rpm 3000 --output engine.wav --duration 5# Install build tools
brew install cmake bison flex boostFor ESP32-S3 target with I2S audio output:
# Install ESP-IDF via EIM (Espressif Installation Manager)
brew tap espressif/eim
brew install eim
eim install # installs ESP-IDF and toolchain
# Build firmware
make esp32
# Flash to connected ESP32-S3
make deploy_esp32
# Flash + serial monitor
make run_esp32Hardware: ESP32-S3 DevKit + MAX98357A I2S amp. Wiring: GPIO 4=BCLK, GPIO 5=LRCLK, GPIO 6=DIN, GND, 3V3.
# Play default engine at 2000 RPM
./build/engine-sim-cli --default-engine --rpm 2000 --play --duration 10
# Play sine wave test at 2000 RPM
./build/engine-sim-cli --sine --rpm 2000 --play --duration 10
# Use custom engine configuration
./build/engine-sim-cli --config path/to/engine.mr --rpm 3000 --play --duration 5
# Interactive mode with keyboard control
./build/engine-sim-cli --default-engine --interactive --play# Export to WAV file
./build/engine-sim-cli --default-engine --rpm 2000 --output engine.wav --duration 5
# Export with custom config
./build/engine-sim-cli --config assets/engines/chevrolet/engine_03_for_e1.mr --rpm 3000 --output my_engine.wav --duration 10| Option | Description | Default |
|---|---|---|
| --default-engine | Use default engine configuration | - |
| --config <file> | Load specific .mr engine config | - |
| --sine | Test with sine wave instead of engine | - |
| --rpm <value> | Set target RPM | 2000 |
| --play | Enable real-time audio playback | false |
| --output <file> | Output WAV file path | - |
| --duration <seconds> | Simulation duration | 3.0 |
| --threaded | Use threaded circular buffer mode (recommended) | sync-pull |
| --interactive | Enable keyboard control | - |
| --silent | Run full audio pipeline at zero volume | - |
| --help | Show help message | - |
# Real-time playback of default engine (threaded mode - recommended)
./build/engine-sim-cli --default-engine --rpm 2000 --play --threaded
# Real-time playback with sine wave test
./build/engine-sim-cli --sine --rpm 1000 --play --duration 20
# Export 10 seconds of audio to WAV
./build/engine-sim-cli --default-engine --rpm 3000 --output engine.wav --duration 10
# Use custom engine configuration
./build/engine-sim-cli --config my_engine.mr --rpm 1500 --output my_engine.wav --duration 5
# Lower physics frequency for faster processing (reduces CPU load)
./build/engine-sim-cli --default-engine --rpm 3000 --play --sim-freq 5000The CLI tool provides a clean command-line interface to the engine-sim audio generation library:
threaded (default): Pre-fills audio buffer, runs physics in separate thread
sync-pull: Renders on-demand in audio callback
This tool uses the same .mr format as the main engine-sim project. You can find example configurations in engine-sim repository.
See V8_ENGINE_GUIDE.md for detailed instructions on running V8 engine configurations like Ferrari F136 and GM LS.
The CLI tool depends on the engine-sim-bridge submodule which wraps the core engine-sim library:
The bridge provides a platform-agnostic IAudioHardwareProvider interface. New hardware targets (ESP32, Android) need only implement this interface — the factory and build system stubs are already in place.
The bridge submodule handles all audio rendering and engine simulation logic. The CLI simply provides configuration, presentation, and user interaction layers.
See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
| Back | FazBrowse Home | New Git URL |