Set volume level immediately for music playback. Avoids hearing a brief blip of sound if you have volume set to 0.

This commit is contained in:
sirlemonhead 2019-12-05 21:20:11 +00:00 committed by Christoph Oelckers
parent a83efd37ff
commit 30879292b8

View file

@ -92,7 +92,7 @@ bool playCDtrack(int nTrack, bool bLoop)
kclose(hFile);
trackhandle = FX_Play(pTrack, nRead, bLoop ? 0 : -1, 0, 0, 255, 255, 255, FX_MUSIC_PRIORITY, fix16_one, MUSIC_ID);
trackhandle = FX_Play(pTrack, nRead, bLoop ? 0 : -1, 0, 0, gMusicVolume, gMusicVolume, gMusicVolume, FX_MUSIC_PRIORITY, fix16_one, MUSIC_ID);
if (trackhandle <= FX_Ok)
{
OSD_Printf("Error playing music track %s", filename);
@ -104,8 +104,6 @@ bool playCDtrack(int nTrack, bool bLoop)
return false;
}
setCDaudiovolume(gMusicVolume);
return true;
}