Torque Valley: Driving, Drift and Crash Sandbox
README.md
EngineVoiceDemo
A stand-in car for hearing engineVoices without a car. It writes the driving contract's car.* named values on its own entity, the same way a real car does. Each run idles, pulls through the gears at full throttle (shift sounds, rpm drops), stutters on the rev limiter, lifts off (overrun pops, blow-off) and slides across tarmac, gravel and grass, then ends in a crash. With voice = "cycle" it moves to the next of the eight voices after every run. With flyby = true it also drives back and forth past center at speed m/s, so you hear the Doppler drop.
Put an EngineVoice on the same entity. If the scene has no AudioListener, the demo puts one on the active camera so the sound is heard (turn that off with listener = false).
local e = entity.spawn("demoCar")
e.position = { 0, 1, -12 }
e.component.add("EngineVoiceDemo", { voice = "cycle" })
e.component.add("EngineVoice")
:state() returns { phase, voice, rpm, gear, runs }.