# Browser AEMS/Ginsu engine mixer, r422

The browser previously mixed only the per-car Ginsu acceleration and coast recordings. It now loads the matching `AuxRAMBankName` AEMS bank from the stock engine profile, decodes the extracted mono PCM16 WAV loops, and sends them with the matched Ginsu pair and `EngineData` profile to the shared AudioWorklet/ScriptProcessor renderer. The packaged build contains 112 AEMS WAV loops across 17 extracted bank IDs.

## Decompiled mix inputs

In the XP-extracted `SPEED2.EXE`, the player audio update at `0x0047c3d1..0x0047c48d` chooses the single/dual Ginsu update path using the sound configuration at `+0x78`. The single path `0x004701a0` scales its live RPM-change input against `EngineData+0x2c`, then interpolates AEMS and Ginsu gain values from `EngineData+0x30/+0x38` and `+0x34/+0x3c`. The dual path `0x00470540` uses the same EngineData mix fields and reads the deceleration mix points from the selected `DualGinsu` row at `+0x24/+0x2c` and `+0x28/+0x30`, with that row's own delta threshold. The channel-volume fields come from EngineData `+0x24/+0x28` and DualGinsu `+0x04/+0x08`.

The browser now interpolates each profile's steady and loaded mix values with the per-frame RPM change and the matching executable threshold. It scales each channel with the extracted volume fields. Its input is signed RPM change for the single path and absolute RPM change for the dual path, following the sign handling visible in those update functions.

## Extracted AEMS playback

Each bank's extracted stream labels are `idle`, `accel-low`, `accel-mid`, `accel-high`, `decel-low`, `decel-mid`, and `decel-high`. The renderer loops these original clips and blends adjacent low/mid/high clips across the profile RPM span; idle is selected near the car's idle RPM. Exact per-clip RPM boundaries and the retail sample-loop crossfade rules are not recovered, so this band mapping remains an approximation. The extracted per-car Ginsu grain/RPM mapping remains in use.

## Host browser check

The packaged viewer at `dist/webgl-city/` reached `City scene ready` in host Chrome. A short W hold moved the 240SX to 7 mph. Debug state reported the `AudioWorklet` running, AEMS bank 18 with all 7 streams decoded, and the original `GIN_Nissan_240SX.gin` / `GIN_240SX_Decel.gin` pair. There were no page exceptions, console errors, failed requests, or HTTP errors. A one-off renderer signal check with the same extracted 240SX Ginsu/AEMS data measured peak 0.5629 and RMS 0.2114, with no clipping.

This establishes asset loading and non-silent bounded renderer output, not a perceptual or retail-game sound match. The XP guest cannot provide a gameplay audio reference, and host Wine is not installed. The [drive capture](../webgl-city/review/images/562-r422-aems-ginsu-drive.png) shows the state but carries no audio.
