local soundeffectsutil = require "soundeffectsutil"

function data()
return {
	tracks = {
		{ name = "vehicle/zis127/idle.wav", refDist = 25.0 },
		
                { name = "vehicle/zis127/drive.wav", refDist = 25.0 }
,

		{ name = "vehicle/zis127/max_drive.wav", refDist = 20.0 },
                { name = "vehicle/zis127/liaz_tires.wav", refDist = 20.0 }	
	},
	events =  {
		horn = { names = { "vehicle/zis127/horn.wav" }, refDist = 25.0 },
		
                openDoors = { names = { "vehicle/zis127/door_open.wav" }, refDist = 5.0 },
		
                closeDoors = { names = { "vehicle/zis127/door_close.wav" }, refDist = 10.0 }
		
	},

	updateFn = function (input)
		return {
			tracks = { 
				{
					gain = soundeffectsutil.sampleCurve({ { .0, .9 }, { 0.1, 0.7 }, { 0.3, 0 } }, input.speed01),
					pitch = soundeffectsutil.sampleCurve({ { .0, 1.0}, { 0.3, 1.1} }, input.speed01),
				},
				{
					gain = soundeffectsutil.sampleCurve({ { .0, .0 }, { 0.01, .3 }, { 0.6, .55 }, { 0.65, .6 }, { 0.9, 0.5 }, { 1.0, .4 } }, input.speed01),
					pitch = soundeffectsutil.sampleCurve({ { .0, .5 }, { .2, .6 }, { .6, .9 }, { .65, .85 }, { 1.0, 1.0 } }, input.speed01),
				},
				{
					gain = soundeffectsutil.sampleCurve({ { .8, .0 }, { 0.91, 1.0 }, { 1.0, 1.0 } }, input.speed01),
					pitch = soundeffectsutil.sampleCurve({ { .8, 1.0 }, { 1.0, 1.2 } }, input.speed01),
				},
                                {
					gain = soundeffectsutil.sampleCurve({ { .0, .0 }, { 1.0, .5 } }, input.speed01),
					pitch = soundeffectsutil.sampleCurve({ { .0, .0 }, { 1.0, 1.0 } }, input.speed01),
				},
				
			
			},
			events = {
				horn = { gain = 1.0, pitch = 1.0 },
				openDoors = { gain = 1.0, pitch = 1.0 },
				closeDoors = { gain = 1.0, pitch = 1.0 }
			}
		}
	end
}
end