fs2open.github.com
fs2open.github.com copied to clipboard
Revenge of the Music Bug Returns
In testing my music management script I ran into a problem where the music wouldn't start when I launch directly into an empty mission, but if I go into the options menu and then return to the game, or go to the main menu, the previosly started music springs to audibility. I'm trying to push through this project so I'm not isolating a repro right now, but I likely can later. Here are the elements I've identified as potentially important.
- The music is played via a stream object created with ad.openAudioStream using AUDIOSTREAM_EVENTMUSIC as the type
- the music is played with stream:play on that object, and is a loop.
- The music is started at volume 0 and it's volume is managed by the script. Starting at volume 1 seems to make it actually play right. This volume management appears to work at least partially otherwise.
- It may or may not be needed to make a sound ingame before the boot to kickstart it works.
It's possible my fade script is actually misbehaving. In that case there's a different bug, that of the API-set volume not being respected. I'll update when I now more.
I'm fairly sure this was me having my fade logic backwards, sadly. Embarrassing. But as I said above, that still suggests a bug in volume handling if changing game states will make script volume adjustments turn off. @Baezon didn't blighted have some bugs with it's dynamic music when going to the menu or something? Or was that someting else?
They were unrelated, and have since been fixed.
@EatThePath has not seen signs of this music bug in a while and is ok with closing this.