Skip to content

About

Command-line interface for engine-sim audio generation

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

460 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

engine-sim-cli

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 Support

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.

Features

  • ✅ Real-time Audio Playback - Hear engine sounds as they're generated (macOS)
  • ✅ WAV Export - Render high-quality engine audio to WAV files
  • ✅ Sine Wave Test Mode - Test audio pipeline with clean sine waves
  • ✅ Engine Configuration Support - Load any .mr engine configuration file
  • ✅ Real-time Statistics - Monitor RPM, load, exhaust flow, etc.
  • ✅ Crackle-Free Audio - Professional-quality audio output
  • ✅ Audio Strategies - Choose between sync-pull (on-demand) or threaded (buffered) rendering

Quick Start

Clone, Build, Run

# 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

Prerequisites

  • macOS only — Linux and Windows builds are currently blocked (no audio hardware provider)
  • CMake 3.20 or higher
  • C++17 compatible compiler (Clang/AppleClang)
  • macOS: AudioUnit framework (built-in, no extra install needed)

macOS Installation

# Install build tools
brew install cmake bison flex boost

ESP32 Setup (Optional)

For 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_esp32

Hardware: ESP32-S3 DevKit + MAX98357A I2S amp. Wiring: GPIO 4=BCLK, GPIO 5=LRCLK, GPIO 6=DIN, GND, 3V3.

Usage

Real-time Playback (macOS)

# 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