Command-line interface for engine-sim audio generation.
This tool allows you to generate engine audio from the command line by running the engine simulator and rendering the output to WAV files.
- Load engine configurations from .mr files
- Render high-quality engine audio to WAV format
- Configurable duration and sample rate
- Real-time statistics reporting (RPM, load, exhaust flow, etc.)
- Simple, intuitive command-line interface
- CMake 3.20 or higher
- C++17 compatible compiler
- OpenAL
- pthreads (usually included with your compiler)
brew install openal-soft cmakesudo apt-get install libopenal-dev cmake build-essentialgit clone https://github.com/danieljsinclair/engine-sim-cli.git
cd engine-sim-cli
mkdir build && cd build
cmake ..
makeThe engine-sim-cli executable will be created in the build directory.
engine-sim-cli <engine_config.mr> <output.wav> [duration_seconds]engine_config.mr- Path to the engine configuration file (.mr format)output.wav- Path where the WAV file will be writtenduration_seconds- (Optional) Duration in seconds (default: 3.0)
# Generate 5 seconds of audio from an engine config
engine-sim-cli assets/engines/chevrolet/engine_03_for_e1.mr output.wav 5.0
# Generate 3 seconds of audio
engine-sim-cli assets/engines/atg-video-1/01_honda_trx520.mr honda.wav 3.0- Engine configs must use absolute paths or be relative to the current directory
- The output is a 32-bit float WAV file at 48kHz stereo
- The simulator automatically ramps up throttle smoothly over the first 0.5 seconds
The CLI tool uses the engine-sim library to:
- Initialize the simulator with appropriate audio settings
- Load an engine configuration from a .mr file
- Start the audio processing thread
- Simulate the engine physics and render audio in real-time
- Write the rendered audio to a WAV file
This tool uses the same .mr format as the main engine-sim project. You can find example configurations in the engine-sim repository.
- engine-sim - Core engine simulation library
- OpenAL - Audio output
- csv-io - CSV parsing (transitive dependency)
See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.