createSFXSource
Definition
-- @/lua/vehicle/sounds.lua:195
local function createSFXSource(filename, description, SFXProfileName, nodeID)
local snd = obj:createSFXSource(filename, description, SFXProfileName, nodeID)
if snd == nil then
M.update = nop
M.playSoundOnceAtNode = nop
M.playSoundOnceFollowNode = nop
log("W", "sounds.createSFXSource", "failed to create sfx source: " .. SFXProfileName .. " from file " .. filename .. " with description " .. description)
return nil
end
return snd
end
Callers
@/lua/vehicle/controller/hydraulicSuspension.lua
local releaseSoundEvent = jbeamData.releaseSample or "event:>Vehicle>Hydraulics>Release_01"
releaseSoundLoop = obj:createSFXSource(releaseSoundEvent, "AudioDefaultLoop3D", "", jbeamData.pumpNode)
obj:setVolumePitch(releaseSoundLoop, 0, 0)
@/lua/vehicle/fire.lua
if fireBurnSoundObj == nil then
fireBurnSoundObj = obj:createSFXSource("event:>Vehicle>Fire>Fire_Burn_Loop", "AudioDefaultLoop3D", "fireburn", -1) or false
fireBurnSoundPlaying = true
@/lua/vehicle/controller/pneumatics.lua
if v.soundDown then
groupData.soundLoopDown = obj:createSFXSource(v.soundDown, "AudioDefaultLoop3D", "pneumatics_down_" .. v.groupName, groupData.soundNode)
end
if v.soundUp then
groupData.soundLoopUp = obj:createSFXSource(v.soundUp, "AudioDefaultLoop3D", "pneumatics_up_" .. v.groupName, groupData.soundNode)
end
@/lua/vehicle/powertrain/turbocharger.lua
local turboHissLoopFilename = turbo.hissLoopEvent or "event:>Vehicle>Forced_Induction>Turbo_01>turbo_hiss"
turboHissLoop = obj:createSFXSource(turboHissLoopFilename, "AudioDefaultLoop3D", "TurbochargerWhine", assignedEngine.engineNodeID)
local turboWhineLoopFilename = turbo.whineLoopEvent or "event:>Vehicle>Forced_Induction>Turbo_01>turbo_spin"
local turboWhineLoopFilename = turbo.whineLoopEvent or "event:>Vehicle>Forced_Induction>Turbo_01>turbo_spin"
turboWhineLoop = obj:createSFXSource(turboWhineLoopFilename, "AudioDefaultLoop3D", "TurbochargerWhine", assignedEngine.engineNodeID)
@/lua/vehicle/sounds.lua
local function createSFXSource(filename, description, SFXProfileName, nodeID)
local snd = obj:createSFXSource(filename, description, SFXProfileName, nodeID)
if snd == nil then
local function createSoundObj(filename, description, SFXProfileName, nodeID)
local sndObj = obj:createSFXSource(filename, description, SFXProfileName, nodeID)
if sndObj == nil then
s.clip = createSoundObj(s.filename, s.profile, s.sfxProfile, s.node)
--log('D', 'sounds.update', 'createSFXSource('..s.sfxProfile..','..s.node..') = '..tostring(s.clip))
if not s.clip then
if scrapeSounds[event] == nil then
scrapeSounds[event] = obj:createSFXSource(event, "AudioDefaultLoop3D", "Scrape", -2)
end