VE Lua Documentation

Press F to search!

setVolumePitch

Definition


-- @/=[C]:-1
function setVolumePitch(...)

Callers

@/lua/vehicle/powertrain/automaticGearbox.lua

  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
@/lua/vehicle/controller/hydraulicSuspension.lua
      lastPumpFlow = currentPumpFlow
      obj:setVolumePitch(pumpSoundLoop, volume, pitch)
    end
  local volume = releaseSoundVolumeSmoother:getUncapped(sqrt(avgBleedCoef), dt)
  obj:setVolumePitch(releaseSoundLoop, volume, 1)
end
  releaseSoundLoop = obj:createSFXSource(releaseSoundEvent, "AudioDefaultLoop3D", "", jbeamData.pumpNode)
  obj:setVolumePitch(releaseSoundLoop, 0, 0)
  isPumpSoundPlaying = false
  obj:setVolumePitch(releaseSoundLoop, 0, 0)
  releaseSoundVolumeSmoother:reset()
@/lua/vehicle/sounds.lua

function soundObj:setVolumePitch(vol, pitch, color, texture)
  if vol < 0.01 then

      snd.clip:setVolumePitch(sndVol, sndPitch)
    end

    snd.clip:setVolumePitch(volume * beamResetTimer, pitch, snd.colorFactor)
    maxStressVolume = max(maxStressVolume, volume)
      local pitch = aeroSpeed * 0.012
      windSound:setVolumePitch(vol, pitch)
    end
    if wd.tireSoundVolumeCoef > 0 then
      wheelSound.rigidRoll:setVolumePitch(rigidRollVolume * wd.tireSoundVolumeCoef, rigidRollPitch, rigidRollColor, rigidSurfaceType)
      wheelSound.rigidSkid:setVolumePitch(rigidSkidVolume * wd.tireSoundVolumeCoef, rigidSkidPitch, rigidSkidSlip + 0.5, rigidSurfaceType)
      wheelSound.rigidRoll:setVolumePitch(rigidRollVolume * wd.tireSoundVolumeCoef, rigidRollPitch, rigidRollColor, rigidSurfaceType)
      wheelSound.rigidSkid:setVolumePitch(rigidSkidVolume * wd.tireSoundVolumeCoef, rigidSkidPitch, rigidSkidSlip + 0.5, rigidSurfaceType)
    end
    if wd.tireSoundVolumeCoef > 0 then
      wheelSound.looseRoll:setVolumePitch(looseRollVolume * wd.tireSoundVolumeCoef, looseRollPitch, looseRollDepth, looseSurfaceType)
      wheelSound.looseSkid:setVolumePitch(looseSkidVolume * wd.tireSoundVolumeCoef, looseSkidPitch, looseSkidDepth, looseSurfaceType)
      wheelSound.looseRoll:setVolumePitch(looseRollVolume * wd.tireSoundVolumeCoef, looseRollPitch, looseRollDepth, looseSurfaceType)
      wheelSound.looseSkid:setVolumePitch(looseSkidVolume * wd.tireSoundVolumeCoef, looseSkidPitch, looseSkidDepth, looseSurfaceType)
    end
            soundTable.resonance = 0
            soundTable.clip:setVolumePitch(0, 0)
            soundTable.noiseFactor = bm.noiseFactor or 0
  if windSound then
    windSound:setVolumePitch(0, 0)
  end
    snd.smoothing:reset()
    snd.clip:setVolumePitch(0, 0)
    snd.noiseTrail = 0
@/lua/vehicle/powertrain/turbocharger.lua
    local hissVolume = max(turboPressure * turboHissVolumePerPascal, 0)
    obj:setVolumePitch(turboHissLoop, hissVolume, 1)
    obj:setVolumePitch(turboWhineLoop, spindleVolume, spindlePitch)
    obj:setVolumePitch(turboHissLoop, hissVolume, 1)
    obj:setVolumePitch(turboWhineLoop, spindleVolume, spindlePitch)
@/lua/vehicle/wheels.lua

      wd.brakeSquealLoop:setVolumePitch(brakeSquealVolume, brakeSquealPitch, brakeSquealColor, 1)
    if wd.brakeSquealLoop then
      wd.brakeSquealLoop:setVolumePitch(brakeSquealVolume, brakeSquealPitch, brakeSquealColor, 1) --always update brake squeal, even if broken
    end
@/lua/vehicle/powertrain/manualGearbox.lua

  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
    end
    device.gearGrindLoop:setVolumePitch(1, abs(avDifference) * avToRPM, 1, 1)
      --start the grinding sound, but keep it silent for now (params are then set from the update logic of the grinding)
      device.gearGrindLoop:setVolumePitch(0, 0, 0, 0)
      obj:playSFX(device.gearGrindLoop.obj)
    if device.gearGrindLoop then
      device.gearGrindLoop:setVolumePitch(0, 0, 0, 0)
      obj:stopSFX(device.gearGrindLoop.obj)
@/lua/vehicle/powertrain/dctGearbox.lua

  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
@/lua/vehicle/powertrain/supercharger.lua
  local pitch = max(blowerAV * whinePitchPerAV, 0)
  whineLoop:setVolumePitch(volume, pitch)
@/lua/vehicle/powertrain/sequentialGearbox.lua

  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
  device.gearWhineOutputLoop:setVolumePitch(volumeOutput, pitchOutput, outputLoad, outputRPMSign)
  device.gearWhineInputLoop:setVolumePitch(volumeInput, pitchInput, inputLoad, outputRPMSign)
@/lua/vehicle/powertrain/combustionEngineThermals.lua
      if radiatorFanSound and not radiatorFanElectricSoundPlaying then
        obj:setVolumePitch(radiatorFanSound, radiatorFanVolume, 1)
        obj:playSFX(radiatorFanSound)
    if radiatorFanSound then
      obj:setVolumePitch(radiatorFanSound, radiatorFanVolume, absEngineRPM / maxEngineRPM)
    end
  if radiatorHissSound then
    obj:setVolumePitch(radiatorHissSound, fluidLeakRates.coolant.overall, M.coolantTemperature / constants.maxCoolantTemperature, 0, 0)
    if fluidLeakRates.coolant.previousOverall <= 0 and fluidLeakRates.coolant.overall > 0 then