diff options
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio.cpp | 13 | ||||
-rw-r--r-- | engines/sci/sound/audio.h | 2 |
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); |