aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-29 13:52:10 +0000
committerFilippos Karapetis2009-05-29 13:52:10 +0000
commit74e87bf05d584b922546b08cc1930c9af3586186 (patch)
treeb3486bb93bc12828d94be1c3d47ea06a0e837247 /engines/sci/engine
parentb042cab3a9d493077045d40b4cb70b0518b522c5 (diff)
downloadscummvm-rg350-74e87bf05d584b922546b08cc1930c9af3586186.tar.gz
scummvm-rg350-74e87bf05d584b922546b08cc1930c9af3586186.tar.bz2
scummvm-rg350-74e87bf05d584b922546b08cc1930c9af3586186.zip
Some WIP code on the speech used in KQ6CD
svn-id: r40996
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/ksound.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 59937853bd..75a5d0979c 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -997,13 +997,24 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->_sound._audioResource->stop();
if (argc == 2) { // KQ5CD, KQ6 floppy
- Audio::AudioStream *audioStream = s->_sound._audioResource->getAudioStream(UKPV(1), &sampleLen);
+ Audio::AudioStream *audioStream = s->_sound._audioResource->getAudioStream(UKPV(1), 65535, &sampleLen);
if (audioStream)
mixer->playInputStream(Audio::Mixer::kSpeechSoundType, s->_sound._audioResource->getAudioHandle(), audioStream);
} else if (argc == 6) { // SQ4CD or newer
- // TODO
- warning("kDoAudio: Play called with new semantics - 5 parameters: %d %d %d %d %d", UKPV(1), UKPV(2), UKPV(3), UKPV(4), UKPV(5));
+ uint32 volume = UKPV(1);
+ // Make a BE number
+ uint32 audioNumber = (((UKPV(2) & 0xFF) << 24) & 0xFF000000) |
+ (((UKPV(3) & 0xFF) << 16) & 0x00FF0000) |
+ (((UKPV(4) & 0xFF) << 8) & 0x0000FF00) |
+ ( (UKPV(5) & 0xFF) & 0x000000FF);
+
+ printf("%d %d %d %d -> %d\n", UKPV(2), UKPV(3), UKPV(4), UKPV(5), audioNumber); // debugging
+
+ Audio::AudioStream *audioStream = s->_sound._audioResource->getAudioStream(audioNumber, UKPV(1), &sampleLen);
+
+ if (audioStream)
+ mixer->playInputStream(Audio::Mixer::kSpeechSoundType, s->_sound._audioResource->getAudioHandle(), audioStream);
} else { // Hopefully, this should never happen
warning("kDoAudio: Play called with an unknown number of parameters (%d)", argc);
}