Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

music_mute_menu and looping tracks #8

Open
jmqw opened this issue Dec 21, 2016 · 0 comments
Open

music_mute_menu and looping tracks #8

jmqw opened this issue Dec 21, 2016 · 0 comments

Comments

@jmqw
Copy link
Contributor

jmqw commented Dec 21, 2016

I found some issues with looping ambient audio tracks when music_mute_menu is enabled in tombati. When you leave the game paused long enough, you'll notice that the next iteration of the track is unmuted. When that iteration finishes, the track stops for good, even when you unpause the game. I traced the problem to this code in musicPlay:

    // this one will always be set back to true on the next tick
    *m_tombCDLoop = FALSE;

    // Calculate volume from current volume setting. The original code used
    // the hardcoded value 0x400400, which equals a volume of 25%.
    uint32_t volume = *m_tombCDVolume * 0xffff / 10;
    volume |= volume << 16;
    auxSetVolume(*m_tombAuxDeviceID, volume);

When the game is paused, m_tombCDLoop is never set back to true, which is why the track eventually stops. Setting the volume unmutes the track.

When I take this code out the problem is fixed, and no new issues seem to arise, i.e. no tracks loop that aren't supposed to, and the volume setting is still maintained. I'm using the WinMM wrapper with FLAC audio tracks you posted on tombraiderforums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant