From 6bc4ace2e5678cb0e17eef2888a2dfb986de2215 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sun, 24 Mar 2024 13:51:04 +0000 Subject: [PATCH] Update sfxSndStream.cpp fix for stereo files (2d sound files) frames report back as bytesPerSample * channels which for us is bytesPerSample. This needs to be applied to the return from read so sfx resource knows we have read all the info. --- Engine/source/sfx/media/sfxSndStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/sfx/media/sfxSndStream.cpp b/Engine/source/sfx/media/sfxSndStream.cpp index 8295eb6f7..3c1d21b17 100644 --- a/Engine/source/sfx/media/sfxSndStream.cpp +++ b/Engine/source/sfx/media/sfxSndStream.cpp @@ -113,7 +113,7 @@ U32 SFXSndStream::read(U8* buffer, U32 length) Con::errorf("SFXSndStream - read: %s", sf_strerror(sndFile)); } - return framesRead; + return framesRead * mFormat.getBytesPerSample(); } bool SFXSndStream::isEOS() const