aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorFilippos Karapetis2011-02-04 17:51:59 +0000
committerFilippos Karapetis2011-02-04 17:51:59 +0000
commit512bcf8b907edd69ed7bed2c988f6aa0b8cdfe69 (patch)
treee16114ba871f957eff4cd0082c84de77c324fabb /engines/sci/sound
parent94b6d23d44ee9d48b4e4631f7d38d16c012bf56b (diff)
downloadscummvm-rg350-512bcf8b907edd69ed7bed2c988f6aa0b8cdfe69.tar.gz
scummvm-rg350-512bcf8b907edd69ed7bed2c988f6aa0b8cdfe69.tar.bz2
scummvm-rg350-512bcf8b907edd69ed7bed2c988f6aa0b8cdfe69.zip
SCI: Rewrote the robot playing code in a way similar to other video decoders
- The code now streams videos instead of loading them in memory, without utilizing seeking - Removed the sound-related robot code from the graphics classes - Started implementing the code for the sound in robot videos (still not finished) svn-id: r55772
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/audio.cpp13
-rw-r--r--engines/sci/sound/audio.h2
2 files changed, 3 insertions, 12 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 1d2d6e8655..4d0e52a2b8 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -243,18 +243,9 @@ 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 *AudioPlayer::getDecodedRobotAudioFrame(Common::SeekableReadStream *str, uint32 encodedSize) {
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);
+ return readSOLAudio(str, encodedSize, 0, flags);
}
Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 volume, int *sampleLen) {
diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h
index 1ad9acc58e..92d7b946f5 100644
--- a/engines/sci/sound/audio.h
+++ b/engines/sci/sound/audio.h
@@ -69,8 +69,8 @@ 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);
+ byte *getDecodedRobotAudioFrame(Common::SeekableReadStream *str, uint32 encodedSize);
int getAudioPosition();
int startAudio(uint16 module, uint32 tuple);
int wPlayAudio(uint16 module, uint32 tuple);