Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

engineVoices

Checks the voice table, voice selection and the synthesis, without playing audio:

  • Voices: the eight voices in car.voiceId order, each with its own id, a label and sane idle / redline / limiter values. An unknown voice raises.
  • Selection from car values: nameOf / idOf are inverse, out-of-range ids fall back to the four, and every torqueCars engine's voiceId selects the voice its catalog entry names (skipped without torqueCars).
  • EngineVoice helpers: attach adds the component (auto by default), attaching again updates the same component, set switches the voice, an unknown voice raises and detach removes the component.
  • Following rpm: firingHz per engine type (four-stroke, two-stroke kart, rotary, electric motor order) is linear in rpm. Every voice's three band references ascend and give a whole number of cycles per second (seamless loops). The baked ev_four_2_on loop peaks exactly on its firing frequency.
  • Following load: every on-load take is louder than its off-load take, in the specs and in rendered samples (v8 band 2). Rendering is deterministic.
  • Tables: every clip the runtime plays resolves (48 loops, aux, shifts, pops, crashes, blow-off, skids), loopName spells the clip names, and the skid sound per surface follows driveSurfaces' order.

It leaves alone the per-frame mix of a live EngineVoice (band weights, smoothing, limiter stutter, pops, Doppler) and actual playback, which run only in play with an audio listener. It also does not re-bake any clips. Stand-in cars are spawned far below the play area and despawned after each test.

Run it in edit mode:

return asset.resolve("engineVoices", "testSuite"):run()