Page MenuHomeFeedback Tracker

Cannot stop/delete createSoundSource[] sounds
Closed, ResolvedPublic


The deleteVehicle doesn't work with dynamic sounds created with createSoundSource[]. It is therefore impossible to stop any sounds started with this function. See steps to reproduce.


Legacy ID
Steps To Reproduce

testSound = createSoundSource ["Sound_Alarm", getPos player, [], 0];

// Won't stop the sound
deleteVehicle testSound;

Event Timeline

simast edited Steps To Reproduce. (Show Details)May 11 2013, 8:11 PM
simast edited Additional Information. (Show Details)
simast set Category to Scripting.
simast set Reproducibility to Always.
simast set Severity to None.
simast set Resolution to Fixed.
simast set Legacy ID to 590232496.May 7 2016, 2:04 PM

can confirm deleteVehicle doesn't delete the sound source

simast added a subscriber: simast.May 7 2016, 2:04 PM

It's weird. I managed to store the createSoundSource[] result with the setVariable on an object (cfgVehicle) - and later was able to simply deleteVehicle this sound and it worked. But the test code with the alarm sound SFX given above still has this issue.

OK, after some more testing I think I know the issue: You cannot use deleteVehicle on sound sources when the game is paused (which is the case when running the above example from debug console).

This is correct

null = [] spawn {testSound = createSoundSource ["Sound_Alarm", getPos player, [], 0]; sleep 5; deletevehicle testSound;}

will stop the sound.

However there is still a problem. This

null = [] spawn {testSound = createSoundSource ["Sound_Alarm", getPos player, [], 0]; uiSleep 5; deletevehicle testSound;}

will not stop the sound if you execute it then press escape for 10 seconds then come back. uiSleep does not pause on pause and so it will try delete sound while ui is on pause and fail.

I think this could be relative

testSound = createSoundSource ["Sound_Alarm", getPos player, [], 0]; hint format ["%1", testSound];

shows "NOID <no shape>" for the sound object.

It works now thanks to Druid. This ticket can be marked fixed.

EDIT the issue is with using it with pause menu as stated above, in MP it works without a hitch.

Mass closing resolved issues not updated since November.