diff options
author | Filippos Karapetis | 2010-12-23 13:11:10 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-12-23 13:11:10 +0000 |
commit | 401a8c355d1b8af353db0df6dab6117cb725f756 (patch) | |
tree | 43efd1b9a15086fb1fac87a2113c31f341e23a71 /engines/sci/sound | |
parent | f891323f1f9a79d0b301aa7f4bfd63e544f901b3 (diff) | |
download | scummvm-rg350-401a8c355d1b8af353db0df6dab6117cb725f756.tar.gz scummvm-rg350-401a8c355d1b8af353db0df6dab6117cb725f756.tar.bz2 scummvm-rg350-401a8c355d1b8af353db0df6dab6117cb725f756.zip |
SCI: Some initial work on the sound of robot videos (doesn't work yet, seems to be a problem with the encoding of the customized SOL audio files in robot videos)
svn-id: r55023
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio.cpp | 14 | ||||
-rw-r--r-- | engines/sci/sound/audio.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 829a94d90c..f2c13cf5f5 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -243,6 +243,20 @@ static byte *readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size, return buffer; } +// FIXME: This doesn't work correctly yet, perhaps there are differences in the +// way the audio in robot files is handled +Audio::RewindableAudioStream *AudioPlayer::getRobotAudioStream(byte *buffer) { + const uint16 rbtHeaderSize = 19; // TODO: is this right? + const uint16 rbtAudioRate = 22050; // Seems to be hardcoded for all Robot videos + byte audioFlags = *(buffer + 6); + byte flags = 0; + uint32 audioSize = READ_LE_UINT16(buffer + 15) - rbtHeaderSize; + + Common::MemoryReadStream dataStream(buffer + rbtHeaderSize - 1, audioSize, DisposeAfterUse::NO); + byte *data = readSOLAudio(&dataStream, audioSize, audioFlags, flags); + return Audio::makeRawStream(data, audioSize, rbtAudioRate, flags); +} + Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 volume, int *sampleLen) { Audio::SeekableAudioStream *audioSeekStream = 0; Audio::RewindableAudioStream *audioStream = 0; diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index 7c1221fc4c..0f075f1b0f 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -65,6 +65,7 @@ public: void setAudioRate(uint16 rate) { _audioRate = rate; } Audio::SoundHandle *getAudioHandle() { return &_audioHandle; } + Audio::RewindableAudioStream *getRobotAudioStream(byte *buffer); Audio::RewindableAudioStream *getAudioStream(uint32 number, uint32 volume, int *sampleLen); int getAudioPosition(); int startAudio(uint16 module, uint32 tuple); |