- backported a few sound code fixes from Raze.

This commit is contained in:
Christoph Oelckers 2020-02-15 09:32:05 +01:00 committed by drfrag
parent 462368b61d
commit 87875a52ba
2 changed files with 3 additions and 2 deletions

View file

@ -44,6 +44,7 @@
#include "filereadermusicinterface.h"
#include "zmusic/zmusic.h"
#include "resourcefiles/resourcefile.h"
#include "version.h"
//==========================================================================
//
@ -426,7 +427,7 @@ void FSoundFontManager::CollectSoundfonts()
if (soundfonts.Size() == 0)
{
ProcessOneFile(NicePath("$PROGDIR/soundfonts/gzdoom.sf2"));
ProcessOneFile(NicePath("$PROGDIR/soundfonts/" GAMENAMELOWERCASE ".sf2"));
}
}

View file

@ -142,7 +142,7 @@ void S_CreateStream()
if (!mus_playing.handle) return;
SoundStreamInfo fmt;
ZMusic_GetStreamInfo(mus_playing.handle, &fmt);
if (fmt.mBufferSize > 0)
if (fmt.mBufferSize > 0) // if buffer size is 0 the library will play the song itself (e.g. Windows system synth.)
{
int flags = fmt.mNumChannels < 0 ? 0 : SoundStream::Float;
if (abs(fmt.mNumChannels) < 2) flags |= SoundStream::Mono;