aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/sound.cpp5
-rw-r--r--engines/mortevielle/sound.h2
-rw-r--r--engines/mortevielle/speech.cpp8
-rw-r--r--engines/mortevielle/speech.h2
-rw-r--r--engines/mortevielle/utils.cpp3
5 files changed, 14 insertions, 6 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index a3ac56c27b..b3edead6f2 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -238,6 +238,11 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
if (_vm->_speechManager._typlec == 0)
return;
+ if (!_vm->_speechManager._buildingSentence) {
+ if (!_mixer->isSoundHandleActive(_soundHandle))
+ _mixer->stopHandle(_speakerHandle);
+ _vm->_speechManager._buildingSentence = true;
+ }
int freq = tempo * 10 * 25.2;
int i = 0;
while (i < _vm->_speechManager._ptr_oct) {
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index dccae0eaab..101a62b348 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -103,6 +103,8 @@ private:
public:
Audio::Mixer *_mixer;
Audio::QueuingAudioStream *_audioStream;
+ Audio::SoundHandle _soundHandle;
+
SoundManager(Audio::Mixer *mixer);
~SoundManager();
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 4940c93754..499f852b55 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -70,6 +70,7 @@ SpeechManager::SpeechManager() {
_queue[i]._rep = 0;
}
_noise5Buf = nullptr;
+ _buildingSentence = false;
}
SpeechManager::~SpeechManager() {
@@ -553,13 +554,10 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
handlePhoneme();
_vm->_soundManager.litph(_tbi, typ, tempo);
+ _vm->_speechManager._buildingSentence = false;
if (typ != 0) {
- Audio::SoundHandle soundHandle;
_vm->_soundManager._audioStream->finish();
- _vm->_soundManager._mixer->playStream(Audio::Mixer::kSFXSoundType, &soundHandle, _vm->_soundManager._audioStream);
- while (_vm->_soundManager._mixer->isSoundHandleActive(soundHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit())
- ;
- _vm->_soundManager._mixer->stopHandle(soundHandle);
+ _vm->_soundManager._mixer->playStream(Audio::Mixer::kSFXSoundType, &_vm->_soundManager._soundHandle, _vm->_soundManager._audioStream);
_vm->_soundManager._audioStream = nullptr;
}
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 0117a61931..aa231c3536 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -58,7 +58,6 @@ private:
int _phonemeNumb;
SpeechQueue _queue[3];
-
public:
int _typlec;
int _ptr_oct;
@@ -67,6 +66,7 @@ public:
int _mlec;
byte *_noise5Buf;
int _noise5Size;
+ bool _buildingSentence;
SpeechManager();
~SpeechManager();
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 603dc6eae4..db1861c146 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -276,6 +276,9 @@ void MortevielleEngine::handleAction() {
if (shouldQuit())
return;
++temps;
+ if (!_soundManager._mixer->isSoundHandleActive(_soundManager._soundHandle) || keyPressed() || _mouseClick) {
+ _soundManager._mixer->stopHandle(_soundManager._soundHandle);
+ }
} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
_inMainGameLoop = false;