A React + TypeScript + Vite application that parses real FIVEM/GTA V audio files (.awc, .dat151.rel, .dat54.rel) and simulates engine sounds using Web Audio API with authentic granular synthesis parameters.
- Complete AWC Parser - Parses ADAT format AWC files from FIVEM/GTA V modpacks
- ADPCM Audio Decoder - Decodes IMA ADPCM compressed audio to PCM
- RelFile Parser - Parses .dat151.rel and .dat54.rel binary configuration files
- Dat151 Engine Settings - Extracts GranularEngineAudioSettings (RPM ranges, volumes, rev limiter, etc.)
- Dat54 Sound Data - Extracts GranularSound parameters (channel volumes, granular clock, pitch settings)
- Granular Audio Synthesis - Multi-layer audio playback (idle, onLoad, offLoad, exhaust)
- Real Engine Parameters - Uses authentic GTA V audio parameters for realistic sound simulation
- Web Audio Integration - Real-time audio mixing based on RPM, throttle, and extracted parameters
- Modpack Support - Loads complete FIVEM audio packs with full .dat file parsing
- TypeScript - Full type safety throughout the codebase
- Node.js 18+ and npm
- Modern browser with Web Audio API support
- Clone the repository:
git clone https://github.com/MushroomFleet/Fivem-EngineSound-Simulator.git
cd Fivem-EngineSound-Simulator/fivem-engine-simulator- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser:
Navigate to
http://localhost:5173(or the port shown in terminal)
npm run buildThe built files will be in the dist/ directory.
-
Click "SELECT FOLDER" or drag-and-drop a FIVEM audio modpack folder
-
The modpack should contain:
fxmanifest.lua- Resource manifest/audioconfig/*.dat151.rel- Engine audio settings (AUDIO_GAMEDATA)/audioconfig/*.dat54.rel- Sound data configuration (AUDIO_SOUNDDATA)/sfx/**/*.awc- Audio wave container files
-
Once loaded, you'll see:
- Audio pack name and AWC file count
- Extracted engine parameters (RPM range, granular clock entries, channel volumes)
-
Enable "Use Real Audio" checkbox to use the loaded audio files
-
Click "START ENGINE" and adjust the throttle slider!
From .dat151.rel (GranularEngineAudioSettings):
- RPM range (minRPMOverride, maxRPMOverride)
- Volume settings (master, idle, accel, decel, engine, exhaust)
- Gear change wobble parameters
- Rev limiter settings
- Synth definitions and presets
From .dat54.rel (GranularSound):
- 6-channel file references and volumes
- Granular clock (RPM-to-grain mapping)
- Loop randomization parameters
- Pitch fraction settings
fivem-engine-simulator/
├── src/
│ ├── types/ # TypeScript type definitions
│ │ ├── awc.types.ts # AWC file format types
│ │ ├── rel.types.ts # RelFile base types
│ │ ├── dat151.types.ts # Dat151 engine settings types
│ │ ├── dat54.types.ts # Dat54 sound data types
│ │ └── engine.types.ts # Combined engine parameters
│ ├── utils/ # Utility classes
│ │ └── BinaryReader.ts # Binary data reading utilities
│ ├── parsers/ # File parsers
│ │ ├── AWCParser.ts # AWC audio container parser
│ │ ├── RelFileParser.ts # Core .rel file parser
│ │ ├── Dat151Parser.ts # Game data parser (engine settings)
│ │ ├── Dat54Parser.ts # Sound data parser (granular sounds)
│ │ └── ModpackParser.ts # FIVEM modpack loader
│ ├── audio/ # Audio engine
│ │ ├── ADPCMDecoder.ts # IMA ADPCM audio decoder
│ │ └── AudioEngine.ts # Web Audio synthesis engine
│ └── components/ # React components
│ └── EngineSimulator.tsx
├── public/ # Static assets
├── index.html # Entry HTML
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies
The parser handles GTA V's .rel file format based on CodeWalker:
RelFile Structure:
├── File Type (4 bytes) - Dat4, Dat54, Dat151, etc.
├── Data Block Length (4 bytes)
├── Data Block (variable) - Contains all entry data
├── Name Table
├── Index Entries - Hash/offset/length for each entry
├── Hash Table
└── Pack Table
Parses 60+ engine audio parameters including:
- Pre/post-submix volumes for engine and exhaust
- Gear change wobble (pitch, volume, speed variances)
- Rev limiter configuration
- Synth definitions for upgraded engines
Parses granular synthesis configuration:
- 6 audio channels with file references
- Channel settings (output buffer, clock index, pitch stretch)
- Granular clock array (RPM → grain index mapping)
- Loop randomization parameters
Multi-layer synthesis with real parameters:
- Idle Layer: Uses channel 0, influenced by idle volume settings
- OnLoad Layer: Uses channel 1, influenced by accel volume
- OffLoad Layer: Uses channel 2, influenced by decel volume
- Exhaust Layer: Uses channel 3, influenced by exhaust volume
Dynamic pitch calculated from granular clock data for authentic RPM-to-pitch mapping.
Requires modern browsers with:
- Web Audio API
- File System Access API (for folder upload)
- ES6+ JavaScript features
Tested on:
- Chrome 90+
- Firefox 88+
- Edge 90+
- Safari 14+
- CodeWalker - GTA V file format documentation
- RageAudioTool - Original audio tool by CamxxCore
- GTA V Audio Documentation - Community documentation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built for the FIVEM modding community.
- AWC/RelFile formats reverse-engineered from GTA V audio files
- Binary parsing based on CodeWalker by dexyfex
- Original audio research by CamxxCore
If you use this codebase in your research or project, please cite:
@software{fivem_engine_sound_simulator,
title = {FIVEM Engine Sound Simulator: Real-time GTA V Audio Parsing and Granular Synthesis},
author = {Drift Johnson},
year = {2025},
url = {https://github.com/MushroomFleet/Fivem-EngineSound-Simulator},
version = {1.0.0}
}