Descriptive Problem Summary:
New sounds added to the cache will play at a louder volume and in the wrong channel.
Numbered Steps to Reproduce Problem:
For Loud Volume :
1.) Play a song/sound, for the first time to add it to the cache.
2.) Then play the sound again, and it will be the regular volume written after its in the cache.
For Wrong Channel :
1.) Have 2 different songs and play them on the same channel, they will overlap.
Delete the cache to retry the problem.
When does the problem NOT occur?
When the song/sound is already in the cache
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? I remember this problem since I started working with BYOND.
ID:1421245
Nov 14 2013, 12:26 am
|
|||||||||||||
Resolved
| |||||||||||||
Nov 14 2013, 5:28 am
|
|
It will be easier to investigate this with a code snippet. Your instructions were a little light on detail. Also I need to ask: Does this happen only with MIDI files, or does it happen with other sounds, or both? They're treated differently, so this distinction matters.
|
So sorry, the code is the whole reason this happen...
I've tested with MIDI, WAV, and OGG. The problem happens the same on all of them. And this is the code that handles the music stuff. The Louder Volume and Wrong Channel problems only happen with these. ChangeBGM(mob/P, file, volume, R) Here is a game that shows the problem. https://www.dropbox.com/s/73s22nsxgvdbkdt/alien%20city.rar All the sound handling stuff that I use is in the soundstuff.dm, and the music is in the BGM folder. To see all the problems 1.) run the game 2.) get near the boss the sounds will overlap, then when the sounds are in the cache 3.) run the game again and get near the boss it will play like normal (and the sounds should be softer) To retry reproducing, delete the cache. |
This was a terrific find. This has existed forever.
Basically, in the olden days BYOND sounds didn't worry so much about channels or other stuff. They did have channels but it was very limited. As a result our code was written so that when a sound request came in and the sound wasn't ready, it just set one of two vars saying a sound needed to play: one for an infinitely repeating sound, one for a one-time sound. But it retained no other information, like channel or volume. Your demo triggered the bug in such a way that two sounds played on top of each other when they were supposed to be on the same channel. I've altered the code to use a proper queue. Now the sound's info is preserved entirely until it comes in, so it can start playing with the correct settings. |
Ahh I see. Thankyou so much for you're help again Lummox JR! I'm looking forward to the update!
|
So sorry! I forgot to post back!! >_<
This glitch was fixed on update 1218, thankyou so much Lummox Jr! |