VE Lua Documentation

Press F to search!

createSoundObj

Definition


-- @/lua/vehicle/sounds.lua:209

local function createSoundObj(filename, description, SFXProfileName, nodeID)
  local sndObj = obj:createSFXSource(filename, description, SFXProfileName, nodeID)
  if sndObj == nil then
    return dummySoundObj
  end
  local data = {obj = sndObj, lastVol = 0, lastPitch = 0, lastColor = 0, lastTexture = 0}
  setmetatable(data, soundObj)
  return data
end

Callers

@/lua/vehicle/powertrain/dctGearbox.lua
  local gearWhineOutputSample = jbeamData.gearWhineOutputEvent or "event:>Vehicle>Transmission>helical_01>twine_out"
  device.gearWhineOutputLoop = sounds.createSoundObj(gearWhineOutputSample, "AudioDefaultLoop3D", "GearWhineOut", device.transmissionNodeID or sounds.engineNode)
  local gearWhineInputSample = jbeamData.gearWhineInputEvent or "event:>Vehicle>Transmission>helical_01>twine_in"
  device.gearWhineInputLoop = sounds.createSoundObj(gearWhineInputSample, "AudioDefaultLoop3D", "GearWhineIn", device.transmissionNodeID or sounds.engineNode)
@/lua/vehicle/wheels.lua
    if wd.brakeTorque or wd.parkingTorque then
      wd.brakeSquealLoop = sounds.createSoundObj(wd.brakeSquealLoop or "event:>Vehicle>Failures>failure_brakes_normal", "AudioDefaultLoop3D", "", wd.node1)
      wd.brakeSquealVolumeSmoother = newTemporalSmoothing(100, 4)
@/lua/vehicle/sounds.lua
    if ai.mode ~= 'traffic' then
      windSound = windSound or createSoundObj(windSoundEvent, "AudioDefaultLoop3D", "WindTestSound", windSoundEventNode)
    end
  if wd.tireSoundVolumeCoef > 0 then
    wh.rigidRoll = createSoundObj("event:>Surfaces>roll_rigid_v2", "AudioDefaultLoop3D", "rigidRoll", wd.node1)
    wh.rigidRoll:setParameter("c_tirPrpVolRol", wh.tirePropertiesVolRoll)
    wh.rigidRoll:setParameter("c_tirPrpSizTrd", wh.tirePropertiesSizeTread)
    wh.rigidSkid = createSoundObj("event:>Surfaces>skid_rigid_v2", "AudioDefaultLoop3D", "rigidSkid", wd.node1)
    wh.rigidSkid:setParameter("c_tirPrpVolSkd", wh.tirePropertiesVolSkid)
    wh.rigidSkid:setParameter("c_tirPrpSoft", wd.softnessCoef)
    wh.looseRoll = createSoundObj("event:>Surfaces>roll_loose_v2", "AudioDefaultLoop3D", "looseRoll", wd.node1)
    wh.looseRoll:setParameter("c_tirPrpVolRol", wh.tirePropertiesVolRoll)
    wh.looseRoll:setParameter("c_tirPrpSizTrd", wh.tirePropertiesSizeTread)
    wh.looseSkid = createSoundObj("event:>Surfaces>skid_loose_v2", "AudioDefaultLoop3D", "looseSkid", wd.node1)
    wh.looseSkid:setParameter("c_tirPrpVolSkd", wh.tirePropertiesVolSkid)

      s.clip = createSoundObj(s.filename, s.profile, s.sfxProfile, s.node)
      --log('D', 'sounds.update', 'createSFXSource('..s.sfxProfile..','..s.node..') = '..tostring(s.clip))
          soundTable.sfxProfile = getNextProfile()
          soundTable.clip = createSoundObj(soundFile, soundProfileType, soundTable.sfxProfile, bm.id1)
          if soundTable.clip then
@/lua/vehicle/powertrain/supercharger.lua
  local whineSample = jbeamData.whineLoopEvent or "event:>Vehicle>Forced_Induction>Supercharger_01>supercharger"
  whineLoop = sounds.createSoundObj(whineSample, "AudioDefaultLoop3D", "superchargerWhine", assignedEngine.engineNodeID)
@/lua/vehicle/powertrain/manualGearbox.lua
  local gearGrindSample = jbeamData.gearGrindEvent or "event:>Vehicle>Transmission>grind>transmissionGrindTest"
  device.gearGrindLoop = sounds.createSoundObj(gearGrindSample, "AudioDefaultLoop3D", "GearGrind", device.transmissionNodeID or sounds.engineNode)
  local gearWhineOutputSample = jbeamData.gearWhineOutputEvent or "event:>Vehicle>Transmission>helical_01>twine_out"
  device.gearWhineOutputLoop = sounds.createSoundObj(gearWhineOutputSample, "AudioDefaultLoop3D", "GearWhineOut", device.transmissionNodeID or sounds.engineNode)
  local gearWhineInputSample = jbeamData.gearWhineInputEvent or "event:>Vehicle>Transmission>helical_01>twine_in"
  device.gearWhineInputLoop = sounds.createSoundObj(gearWhineInputSample, "AudioDefaultLoop3D", "GearWhineIn", device.transmissionNodeID or sounds.engineNode)
@/lua/vehicle/powertrain/automaticGearbox.lua
  local gearWhineOutputSample = jbeamData.gearWhineOutputEvent or "event:>Vehicle>Transmission>helical_01>twine_out"
  device.gearWhineOutputLoop = sounds.createSoundObj(gearWhineOutputSample, "AudioDefaultLoop3D", "GearWhineOut", device.transmissionNodeID or sounds.engineNode)
  local gearWhineInputSample = jbeamData.gearWhineInputEvent or "event:>Vehicle>Transmission>helical_01>twine_in"
  device.gearWhineInputLoop = sounds.createSoundObj(gearWhineInputSample, "AudioDefaultLoop3D", "GearWhineIn", device.transmissionNodeID or sounds.engineNode)
@/lua/vehicle/powertrain/sequentialGearbox.lua
  local gearWhineOutputSample = jbeamData.gearWhineOutputEvent or "event:>Vehicle>Transmission>straight_01>twine_out_race"
  device.gearWhineOutputLoop = sounds.createSoundObj(gearWhineOutputSample, "AudioDefaultLoop3D", "GearWhineOut", device.transmissionNodeID or sounds.engineNode)
  local gearWhineInputSample = jbeamData.gearWhineInputEvent or "event:>Vehicle>Transmission>straight_01>twine_in_race"
  device.gearWhineInputLoop = sounds.createSoundObj(gearWhineInputSample, "AudioDefaultLoop3D", "GearWhineIn", device.transmissionNodeID or sounds.engineNode)