Hello everyone, for some reason I am currently trying to mute and unmute the engine sound while the game is running. To do so I found the function setEngineSoundParameter(vehicleId, engineId, paramName, paramValue). I do know how to get the vehicleId and I do know which paramName (engineVolume) and paramValue (0) to use (or at least I think so, can't try it out just yet). But I can't figure out how to get the engineId. Does anyone know how to get the Id of the engine? Thanks in advance, Stiegfried
powertrain.getDevice("mainEngine").engineSoundID seems to sequentially number the engines in a vehicle, so for most cars its 0. If the engine doesn't have a soundconfig it's nil.
Thanks for the response, as you mentioned it returned either 0 or nil depending on the vehicle I tried it on. I already tried 0 but sadly either that's not it or setEngineSoundParameter(be:getPlayerVehicleID(0),0,"engineVolume",0) just doesn't work. I would consider that a possibility as I found that for example the function delEngineSound looks like this: local function delEngineSound(vehicleId) end Or I just didn't get the other parameters right, though the console doesn't display an error when I try that but nothing happens (as far as I can tell). Anybody got any other ideas on how to get this working?
Try main_gain instead of engineVolume. Will have to be a big negative number to completely mute the sounds.
Doesn't work either. What I forgot to mention: A solution to mute the entire game would be fine as well. I was only asking specifically for the engine as I already found a way for all the other sound sources. However I just found settings.setValue("AudioMasterVol",0,nil,nil) which works perfectly fine for my needs. Thanks for your efforts anyways.