Descriptive Problem Summary:
I've had reports from players that sounds don't always stop playing. This is annoying for players as they can hear multiple songs at the same time.
I think there's a bug that causes the client to forget which channel a sound is being played on. No matter how many times I send sound(null, channel = 4) the sound that I previously started on the same channel does not stop on some clients.
Expected Results:
When I send a sound to the client on a specific channel it should always bind to that channel.
When I send a sound to a client with channel=0 it should NOT bind to a specific channel but use a "temporary"/"private" channel instead (i.e., that is not exposed to the developer). I don't care about sounds playing with channel=0 but from the documentation it makes me think it will pick a random channel, which may end up being a channel that I'll use at some point in the future.
Actual Results:
To me it's unclear how sounds and channels work. Sounds played on a specific channel can't be stopped on some clients, forcing me to stop all sounds on all channels by using sound(null, channel = -1).
Does the problem occur:
Every time? Or how often?
Varies, but when it occurs the sound can't ever be stopped without stopping all sounds or waiting for the sound to end (which only works if repeat=0)
In other games?
I've seen this happen in more than one game.
In other user accounts?
On other computers?
I've seen this happen to multiple players with varying configurations.
When does the problem NOT occur?
Unknown - the problem occurs for some people but not for all. It seems to be intermittent.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Before 3.5 this problem never occurred, so something must have happened in the sound overhaul.
Workarounds:
The only workaround is to stop all sounds, which I think is inadequate.
ID:1518573
Mar 15 2014, 9:02 am
|
|||||||||||||
| |||||||||||||
One question worth asking is if you're sure the sounds are binding to a specific channel as you thought.
Regarding channel=0, you're correct that the sound driver will pick an available channel. I'm not sure how that choice is made and it may well vary from system to system. It might be feasible to do a more indirect mapping of DM channel to internal channel, which would get around this, but it's hard to say right off the bat. The one thing I can tell you is I don't see any evidence of code that would prevent sounds from stopping once bound to a channel, which suggests the binding did not happen as you expected.