[Bug] Short sound effect breakdown while TimeBox departs (FIXED)

2 replies [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 26 weeks 6 days ago. Offline
Joined: 2012-06-20
Posts: 1304

This bug seems to be very old but I never got around to report it so far.

It is also present in 0.9.22.

When a TimeBox has just begun to depart (turning invisible), other sound effects don't seem to be able to play for a while. The TimeBox sound as well the music work ok, it is just that for a moment, new sound effects aren't added when they should play in that moment.

For instance, if the TimeBox just departs, and the next turn starts and you immediately fire a bazooka, you will probably not hear the bazooka launch sound nor its explosion. And probably some other related sounds.

When the TimeBox is done with everything, sound turns back to normal.

I am not entirely sure when exactly the sound breaks down. Maybe it also happens when the TimeBox began to appear, but I haven't seen a reliable pattern yet.

Hi, I am a Hedgewars developer. Smile

nemo
nemo's picture
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Hm. I'd noticed this too, but just assumed it was due to limitations of my sound system. Although, that doesn't make a huge amount of sense. We should have at least 16 channels, and software mixers shouldn't have any particular limitations.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Wuzzy
Wuzzy's picture
User offline. Last seen 26 weeks 6 days ago. Offline
Joined: 2012-06-20
Posts: 1304

I just fixed it! Smile

https://hg.hedgewars.org/hedgewars/rev/c98179b00740

The problem was that StopSoundChan was periodically called with the old sound ID (e.g. 0), after the sound has already been played and cleared up.

This caused new sounds to be instantly be stopped for a short period of time.

The solution is to set Gear^.SoundChannel to -1 after the sound has been stopped so any subsequent calls to StopSoundChan become a no-op.

Hi, I am a Hedgewars developer. Smile

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]