From 878e7691cee9c7a7d466e11a3afcb8169f56260c Mon Sep 17 00:00:00 2001 From: gewlitys Date: Wed, 2 Jul 2003 20:23:07 +0000 Subject: [PATCH] Absence of voice files is now automatically detected (bug #309) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1008 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/libs/sound/trackplayer.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 4ccf264de..9bcaf1aab 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.3: +- Absence of voice files is now automatically detected (bug #309) -Mika - Fixed Commander Hayes mouth movement before radioactives are given (bug #343) -Mika - Fix glitches in slylandro probe animation (bugs #398, #399), from Paxtez diff --git a/sc2/src/sc2code/libs/sound/trackplayer.c b/sc2/src/sc2code/libs/sound/trackplayer.c index 378cf05e6..be449d6b0 100644 --- a/sc2/src/sc2code/libs/sound/trackplayer.c +++ b/sc2/src/sc2code/libs/sound/trackplayer.c @@ -495,6 +495,15 @@ SpliceTrack (UNICODE *TrackName, UNICODE *TrackText, UNICODE *TimeStamp, void (* // last_chain->decoder->frequency, // last_chain->decoder->format); + if (last_chain->decoder->type == SOUNDDECODER_NULL && + speechVolumeScale != 0.0f) + { + /* No voice ogg available so zeroing speech volume to + ensure proper operation of oscilloscope and music fading */ + speechVolumeScale = 0.0f; + fprintf (stderr, "SpliceTrack(): no voice ogg available so setting speech volume to zero\n"); + } + sound_sample->length += last_chain->decoder->length; if (! no_page_break) {