From 4b996e7de7d25a650f1ae73722af827fcab7b4d6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 23 Jan 2010 23:55:35 +0000 Subject: Reorder params to Audio::makeRawMemoryStream svn-id: r47492 --- engines/agos/sound.cpp | 4 ++-- engines/cine/sound.cpp | 2 +- engines/draci/sound.cpp | 2 +- engines/drascula/sound.cpp | 2 +- engines/kyra/sound_towns.cpp | 8 ++++---- engines/m4/sound.cpp | 6 +++--- engines/made/resource.cpp | 2 +- engines/mohawk/sound.cpp | 4 ++-- engines/mohawk/video/qt_player.cpp | 2 +- engines/parallaction/sound_br.cpp | 4 ++-- engines/parallaction/sound_ns.cpp | 2 +- engines/queen/sound.cpp | 4 ++-- engines/saga/sound.cpp | 2 +- engines/sci/sound/audio.cpp | 2 +- engines/sci/sound/iterator/iterator.cpp | 2 +- engines/sci/sound/music.cpp | 2 +- engines/scumm/he/cup_player_he.cpp | 3 ++- engines/scumm/he/sound_he.cpp | 10 +++++----- engines/scumm/player_mod.cpp | 2 +- engines/scumm/sound.cpp | 10 +++++----- engines/sky/intro.cpp | 9 +++------ engines/sky/sound.cpp | 7 ++++--- engines/sword1/sound.cpp | 4 ++-- engines/teenagent/teenagent.cpp | 2 +- engines/tinsel/sound.cpp | 2 +- engines/tucker/sequences.cpp | 2 +- 26 files changed, 50 insertions(+), 51 deletions(-) (limited to 'engines') diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index b281f4ecc1..82681378eb 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -292,7 +292,7 @@ Audio::AudioStream *RawSound::makeAudioStream(uint sound) { assert(buffer); _file->read(buffer, size); - return Audio::makeRawMemoryStream(buffer, size, DisposeAfterUse::YES, 22050, _flags); + return Audio::makeRawMemoryStream(buffer, size, 22050, _flags); } void RawSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, bool loop, int vol) { @@ -737,7 +737,7 @@ void Sound::playRawData(byte *soundData, uint sound, uint size, uint freq) { if (_vm->getPlatform() == Common::kPlatformPC) flags = Audio::FLAG_UNSIGNED; - Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, size, DisposeAfterUse::YES, freq, flags); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, size, freq, flags); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_effectsHandle, stream); } diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index ba98dd7865..2184e7a961 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -845,7 +845,7 @@ void PaulaSound::update() { void PaulaSound::playSoundChannel(int channel, int frequency, uint8 *data, int size, int volume) { assert(frequency > 0); frequency = PAULA_FREQ / frequency; - Audio::AudioStream *stream = Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, frequency, 0); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(data, size, frequency, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_channelsTable[channel], stream); _mixer->setChannelVolume(_channelsTable[channel], volume * Audio::Mixer::kMaxChannelVolume / 63); } diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index dfe5b7a045..ee19440139 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -202,7 +202,7 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffe // Don't use DisposeAfterUse::YES, because our caching system deletes samples by itself. Audio::AudioStream *stream = Audio::makeLoopingAudioStream( - Audio::makeRawMemoryStream(buffer._data, buffer._length, DisposeAfterUse::NO, buffer._frequency, flags), + Audio::makeRawMemoryStream(buffer._data, buffer._length, buffer._frequency, flags, DisposeAfterUse::NO), loop ? 0 : 1); _mixer->playInputStream(soundType, handle, stream, -1, volume); } diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 9c17a77216..2893fba728 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -185,7 +185,7 @@ void DrasculaEngine::playFile(const char *fname) { if (ConfMan.getBool("speech_mute")) memset(soundData, 0x80, soundSize); // Mute speech but keep the pause - Audio::AudioStream *stream = Audio::makeRawMemoryStream(soundData, soundSize - 64, DisposeAfterUse::YES, + Audio::AudioStream *stream = Audio::makeRawMemoryStream(soundData, soundSize - 64, 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, stream); } else diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index eabdae27d8..ce7658ee63 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -3925,8 +3925,8 @@ void SoundTowns::playSoundEffect(uint8 track) { uint32 outputRate = uint32(11025 * calculatePhaseStep(note, sfxRootNoteOffs, sfxRate, 11025, 0x2000)); - _currentSFX = Audio::makeRawMemoryStream(sfxPlaybackBuffer, playbackBufferSize, DisposeAfterUse::YES, - outputRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); + _currentSFX = Audio::makeRawMemoryStream(sfxPlaybackBuffer, playbackBufferSize, + outputRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, _currentSFX); } @@ -4297,8 +4297,8 @@ int32 SoundTownsPC98_v2::voicePlay(const char *file, Audio::SoundHandle *handle, uint32 outputRate = uint32(11025 * SoundTowns::calculatePhaseStep(0x3c, 0x3c, sfxRate, 11025, 0x2000)); - _currentSFX = Audio::makeRawMemoryStream(sfx, outsize, DisposeAfterUse::YES, outputRate, - Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); + _currentSFX = Audio::makeRawMemoryStream(sfx, outsize, outputRate, + Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h], _currentSFX); if (handle) *handle = _soundChannels[h]; diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index 654ce7bcbd..06d73a9ac7 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -94,7 +94,7 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel) // Sound format is 8bit mono, unsigned, 11025kHz Audio::AudioStream *stream = Audio::makeLoopingAudioStream( - Audio::makeRawMemoryStream(buffer, bufferSize, DisposeAfterUse::YES, 11025, Audio::FLAG_UNSIGNED), + Audio::makeRawMemoryStream(buffer, bufferSize, 11025, Audio::FLAG_UNSIGNED), loop ? 0 : 1); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &handle->handle, stream, -1, volume); } @@ -146,7 +146,7 @@ void Sound::playVoice(const char *soundName, int volume) { _vm->res()->toss(soundName); // Voice format is 8bit mono, unsigned, 11025kHz - Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, soundStream->size(), DisposeAfterUse::YES, 11025, Audio::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, soundStream->size(), 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &handle->handle, stream, -1, volume); } @@ -260,7 +260,7 @@ void Sound::playDSRSound(int soundIndex, int volume, bool loop) { // Play sound Audio::AudioStream *stream = Audio::makeLoopingAudioStream( Audio::makeRawMemoryStream(buffer, - _dsrFile.dsrEntries[soundIndex]->uncompSize, DisposeAfterUse::YES, + _dsrFile.dsrEntries[soundIndex]->uncompSize, _dsrFile.dsrEntries[soundIndex]->frequency, Audio::FLAG_UNSIGNED), loop ? 0 : 1); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &handle->handle, stream, -1, volume); diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index 80c8a28687..26662d4fb5 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -262,7 +262,7 @@ void SoundResource::load(byte *source, int size) { Audio::AudioStream *SoundResource::getAudioStream(int soundRate, bool loop) { Audio::RewindableAudioStream *stream = - Audio::makeRawMemoryStream(_soundData, _soundSize, DisposeAfterUse::NO, soundRate, Audio::FLAG_UNSIGNED); + Audio::makeRawMemoryStream(_soundData, _soundSize, soundRate, Audio::FLAG_UNSIGNED, DisposeAfterUse::NO); if (loop) return Audio::makeLoopingAudioStream(stream, 0); diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index c2954358fd..97e4b91386 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -454,7 +454,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre if (data_chunk.channels == 2) flags |= Audio::FLAG_STEREO; - return Audio::makeRawMemoryStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES, data_chunk.sample_rate, flags); + return Audio::makeRawMemoryStream(data_chunk.audio_data, data_chunk.size, data_chunk.sample_rate, flags); } else if (data_chunk.encoding == kCodecADPCM) { Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES); uint32 blockAlign = data_chunk.channels * data_chunk.bitsPerSample / 8; @@ -494,7 +494,7 @@ Audio::AudioStream *Sound::makeOldMohawkWaveStream(Common::SeekableReadStream *s stream->read(data, size); delete stream; - return Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED); + return Audio::makeRawMemoryStream(data, size, rate, Audio::FLAG_UNSIGNED); } SndHandle *Sound::getHandle() { diff --git a/engines/mohawk/video/qt_player.cpp b/engines/mohawk/video/qt_player.cpp index f62968d383..b35f43ca2d 100644 --- a/engines/mohawk/video/qt_player.cpp +++ b/engines/mohawk/video/qt_player.cpp @@ -1170,7 +1170,7 @@ Audio::AudioStream *QTPlayer::createAudioStream(Common::SeekableReadStream *stre byte *data = (byte *)malloc(dataSize); stream->read(data, dataSize); delete stream; - return Audio::makeRawMemoryStream(data, dataSize, DisposeAfterUse::YES, _streams[_audioStreamIndex]->sample_rate, flags); + return Audio::makeRawMemoryStream(data, dataSize, _streams[_audioStreamIndex]->sample_rate, flags); } else if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('ima4')) { // Riven uses this codec (as do some Myst ME videos) return Audio::makeADPCMStream(stream, true, stream->size(), Audio::kADPCMApple, _streams[_audioStreamIndex]->sample_rate, _streams[_audioStreamIndex]->channels, 34); diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index c144ec8662..c03d4a19ce 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -416,7 +416,7 @@ Audio::AudioStream *DosSoundMan_br::loadChannelData(const char *filename, Channe int rate = 11025; ch->stream = Audio::makeLoopingAudioStream( - Audio::makeRawMemoryStream(data, dataSize, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED), + Audio::makeRawMemoryStream(data, dataSize, rate, Audio::FLAG_UNSIGNED), looping ? 0 : 1); return ch->stream; } @@ -477,7 +477,7 @@ Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Chan // TODO: Confirm sound rate int rate = 11025; - input = Audio::makeRawMemoryStream((byte *)data, dataSize, DisposeAfterUse::YES, rate, 0); + input = Audio::makeRawMemoryStream((byte *)data, dataSize, rate, 0); } else { input = Audio::make8SVXStream(*stream, looping); } diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 07a7ab7828..939b52a767 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -377,7 +377,7 @@ Audio::AudioStream *AmigaSoundMan_ns::loadChannelData(const char *filename, Chan if (!scumm_stricmp("beep", filename)) { int rate = 11934; ch->volume = 160; - input = Audio::makeRawMemoryStream((byte *)beepSoundBuffer, beepSoundBufferSize, DisposeAfterUse::NO, rate, 0); + input = Audio::makeRawMemoryStream((byte *)beepSoundBuffer, beepSoundBufferSize, rate, 0, DisposeAfterUse::NO); } else { Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename); input = Audio::make8SVXStream(*stream, looping); diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index 089a2ac379..619efcf6db 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -330,7 +330,7 @@ void SBSound::playSoundData(Common::File *f, uint32 size, Audio::SoundHandle *so f->read(sound, size); Audio::Mixer::SoundType type = (soundHandle == &_speechHandle) ? Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; - Audio::AudioStream *stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, 11840, Audio::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(sound, size, 11840, Audio::FLAG_UNSIGNED); _mixer->playInputStream(type, soundHandle, stream); } } @@ -614,7 +614,7 @@ void AmigaSound::playSound(const char *base) { if (soundData) { f->read(soundData, soundSize); - Audio::AudioStream *stream = Audio::makeRawMemoryStream(soundData, soundSize, DisposeAfterUse::YES, 11025, 0); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(soundData, soundSize, 11025, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, stream); } } diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 5bbe89e915..d87c025719 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -73,7 +73,7 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundBuffer &buffe Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; if (!buffer.isCompressed) { - stream = Audio::makeRawMemoryStream(buffer.buffer, buffer.size, DisposeAfterUse::YES, buffer.frequency, buffer.flags); + stream = Audio::makeRawMemoryStream(buffer.buffer, buffer.size, buffer.frequency, buffer.flags); } else { Common::SeekableReadStream *memStream = new Common::MemoryReadStream(buffer.buffer, buffer.size, DisposeAfterUse::YES); diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index d2986a301b..e350e3dba2 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -245,7 +245,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 } if (data) - audioStream = Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, _audioRate, flags); + audioStream = Audio::makeRawMemoryStream(data, size, _audioRate, flags); if (audioStream) { *sampleLen = (flags & Audio::FLAG_16BITS ? size >> 1 : size) * 60 / _audioRate; diff --git a/engines/sci/sound/iterator/iterator.cpp b/engines/sci/sound/iterator/iterator.cpp index 2c54b0bdee..d4e79590ca 100644 --- a/engines/sci/sound/iterator/iterator.cpp +++ b/engines/sci/sound/iterator/iterator.cpp @@ -552,7 +552,7 @@ static Audio::AudioStream *makeStream(byte *data, int size, int rate) { // Convert stream format flags int flags = Audio::FLAG_UNSIGNED; - return Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, flags, 0, 0); + return Audio::makeRawMemoryStream(sound, size, rate, flags); } Audio::AudioStream *Sci0SongIterator::getAudioStream() { diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 13be36b488..6af0597027 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -184,7 +184,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { // Amiga SCI1 games had signed sound data if (_soundVersion >= SCI_VERSION_1_EARLY && ((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga) flags = 0; - pSnd->pStreamAud = Audio::makeRawMemoryStream(channelData, track->digitalSampleSize, DisposeAfterUse::NO, track->digitalSampleRate, flags); + pSnd->pStreamAud = Audio::makeRawMemoryStream(channelData, track->digitalSampleSize, track->digitalSampleRate, flags, DisposeAfterUse::NO); delete pSnd->pLoopStream; pSnd->pLoopStream = 0; pSnd->soundType = Audio::Mixer::kSFXSoundType; diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 49084d6a71..c3dea409e5 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -171,7 +171,8 @@ void CUP_Player::updateSfx() { uint32 soundSize = READ_BE_UINT32(soundData + 4); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &sfxChannel->handle, Audio::makeLoopingAudioStream( - Audio::makeRawMemoryStream(soundData + 8, soundSize - 8, DisposeAfterUse::NO, 11025, Audio::FLAG_UNSIGNED), + Audio::makeRawMemoryStream(soundData + 8, soundSize - 8, + 11025, Audio::FLAG_UNSIGNED, DisposeAfterUse::NO), (sfx->flags & kSfxFlagLoop) ? 0 : 1 ) ); diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 48adca2ca9..69e18fee76 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -574,7 +574,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) musicFile.close(); if (_vm->_game.heversion == 70) { - stream = Audio::makeRawMemoryStream(spoolPtr, size, DisposeAfterUse::NO, 11025, flags); + stream = Audio::makeRawMemoryStream(spoolPtr, size, 11025, flags, DisposeAfterUse::NO); _mixer->playInputStream(type, &_heSoundChannels[heChannel], stream, soundID); return; } @@ -667,9 +667,9 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) #ifdef SCUMM_LITTLE_ENDIAN flags |= Audio::FLAG_LITTLE_ENDIAN; #endif - stream = Audio::makeRawMemoryStream(sound + heOffset, size - heOffset, DisposeAfterUse::YES, rate, flags); + stream = Audio::makeRawMemoryStream(sound + heOffset, size - heOffset, rate, flags); } else { - stream = Audio::makeRawMemoryStream(ptr + memStream.pos() + heOffset, size - heOffset, DisposeAfterUse::YES, rate, flags); + stream = Audio::makeRawMemoryStream(ptr + memStream.pos() + heOffset, size - heOffset, rate, flags); } _mixer->playInputStream(type, &_heSoundChannels[heChannel], Audio::makeLoopingAudioStream(stream, (heFlags & 1) ? 0 : 1), soundID); @@ -729,7 +729,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) _mixer->stopHandle(_heSoundChannels[heChannel]); - stream = Audio::makeRawMemoryStream(ptr + heOffset + 8, size, DisposeAfterUse::NO, rate, flags); + stream = Audio::makeRawMemoryStream(ptr + heOffset + 8, size, rate, flags, DisposeAfterUse::NO); _mixer->playInputStream(type, &_heSoundChannels[heChannel], Audio::makeLoopingAudioStream(stream, (heFlags & 1) ? 0 : 1), soundID); } @@ -750,7 +750,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) _mixer->stopID(_currentMusic); _currentMusic = soundID; - stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, 0); + stream = Audio::makeRawMemoryStream(sound, size, rate, 0); _mixer->playInputStream(Audio::Mixer::kMusicSoundType, NULL, stream, soundID); } else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) { diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index bbbd87fd2a..be7abea47c 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -95,7 +95,7 @@ void Player_MOD::startChannel(int id, void *data, int size, int rate, uint8 vol, _channels[i].pan = pan; _channels[i].freq = rate; _channels[i].ctr = 0; - _channels[i].input = Audio::makeRawMemoryStream_OLD((const byte*)data, size, DisposeAfterUse::YES, rate, 0, loopStart, loopEnd); + _channels[i].input = Audio::makeRawMemoryStream_OLD((const byte*)data, size, rate, 0, loopStart, loopEnd); // read the first sample _channels[i].input->readBuffer(&_channels[i].pos, 1); } diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 6061c775a9..64d2e284ce 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -203,7 +203,7 @@ void Sound::playSound(int soundID) { sound = (byte *)malloc(size); memcpy(sound, ptr, size); - stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(sound, size, rate, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); } // WORKAROUND bug # 1311447 @@ -226,7 +226,7 @@ void Sound::playSound(int soundID) { // Allocate a sound buffer, copy the data into it, and play sound = (byte *)malloc(size); memcpy(sound, ptr, size); - stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(sound, size, rate, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); } // Support for sampled sound effects in Monkey Island 1 and 2 @@ -298,7 +298,7 @@ void Sound::playSound(int soundID) { // Allocate a sound buffer, copy the data into it, and play sound = (byte *)malloc(size); memcpy(sound, ptr + 6, size); - stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(sound, size, rate, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); } else if ((_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 3) || READ_BE_UINT32(ptr) == MKID_BE('SOUN') || READ_BE_UINT32(ptr) == MKID_BE('TOWS')) { @@ -349,7 +349,7 @@ void Sound::playSound(int soundID) { } size -= waveSize; - stream = Audio::makeRawMemoryStream_OLD(sound, waveSize, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED, loopStart, loopEnd); + stream = Audio::makeRawMemoryStream_OLD(sound, waveSize, rate, Audio::FLAG_UNSIGNED, loopStart, loopEnd); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); } break; @@ -440,7 +440,7 @@ void Sound::playSound(int soundID) { } memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size); - stream = Audio::makeRawMemoryStream_OLD(sound, size, DisposeAfterUse::YES, rate, 0, loopStart, loopEnd); + stream = Audio::makeRawMemoryStream_OLD(sound, size, rate, 0, loopStart, loopEnd); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, vol, 0); } else { diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 991a763750..4b8e09272a 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -739,8 +739,7 @@ bool Intro::nextPart(uint16 *&data) { // directly, but this will have to do for now. memset(vData, 127, sizeof(DataFileHeader)); - stream = Audio::makeRawMemoryStream(vData, _skyDisk->_lastLoadedFileSize, DisposeAfterUse::YES, - 11025, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(vData, _skyDisk->_lastLoadedFileSize, 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_voice, stream, SOUND_VOICE); return true; case WAITVOICE: @@ -756,14 +755,12 @@ bool Intro::nextPart(uint16 *&data) { return true; case LOOPBG: _mixer->stopID(SOUND_BG); - stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, DisposeAfterUse::YES, - 11025, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSfx, Audio::makeLoopingAudioStream(stream, 0), SOUND_BG); return true; case PLAYBG: _mixer->stopID(SOUND_BG); - stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, DisposeAfterUse::YES, - 11025, Audio::FLAG_UNSIGNED); + stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSfx, stream, SOUND_BG); return true; case STOPBG: diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 2a00dbb492..5b7f59c772 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -1045,7 +1045,7 @@ void Sound::playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *h _mixer->stopID(id); - Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, size, DisposeAfterUse::YES, 11025, flags); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, size, 11025, flags); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, stream, id); } @@ -1117,7 +1117,8 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) { loopEnd = dataSize; } - Audio::AudioStream *stream = Audio::makeRawMemoryStream_OLD(_soundData + dataOfs, dataSize, DisposeAfterUse::NO, sampleRate, Audio::FLAG_UNSIGNED, loopSta, loopEnd); + Audio::AudioStream *stream = Audio::makeRawMemoryStream_OLD(_soundData + dataOfs, dataSize, sampleRate, + Audio::FLAG_UNSIGNED, loopSta, loopEnd, DisposeAfterUse::NO); if (channel == 0) _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound0, stream, SOUND_CH0, volume, 0); @@ -1245,7 +1246,7 @@ bool Sound::startSpeech(uint16 textNum) { _mixer->stopID(SOUND_SPEECH); - Audio::AudioStream *stream = Audio::makeRawMemoryStream(playBuffer, speechSize, DisposeAfterUse::YES, rate, Audio::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(playBuffer, speechSize, rate, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_ingameSpeech, stream, SOUND_SPEECH); return true; } diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index d3ef4382e0..d28ab8efd9 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -271,7 +271,7 @@ void Sound::playSample(QueueElement *elem) { if (READ_LE_UINT16(sampleData + 0x16) == 2) flags |= Audio::FLAG_STEREO; Audio::AudioStream *stream = Audio::makeLoopingAudioStream( - Audio::makeRawMemoryStream(sampleData + 0x2C, size, DisposeAfterUse::NO, 11025, flags), + Audio::makeRawMemoryStream(sampleData + 0x2C, size, 11025, flags, DisposeAfterUse::NO), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &elem->handle, stream, elem->id, volume, pan); } @@ -360,7 +360,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { uint32 size; int16 *data = uncompressSpeech(index + _cowHeaderSize, sampleSize, &size); if (data) { - stream = Audio::makeRawMemoryStream((byte *)data, size, DisposeAfterUse::YES, 11025, SPEECH_FLAGS); + stream = Audio::makeRawMemoryStream((byte *)data, size, 11025, SPEECH_FLAGS); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream, SOUND_SPEECH_ID, speechVol, speechPan); } } else if (_cowMode == CowPSX && sampleSize != 0xffffffff) { diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 29eedd7c52..825d12776a 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -898,7 +898,7 @@ void TeenAgentEngine::playSoundNow(byte id) { in->read(data, size); //debug(0, "playing %u samples...", size); - Audio::AudioStream *stream = Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, 11025, 0); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(data, size, 11025, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream); } diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index e636458032..1914f4d696 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -154,7 +154,7 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound #endif break; default: - sampleStream = Audio::makeRawMemoryStream(sampleBuf, sampleLen, DisposeAfterUse::YES, 22050, Audio::FLAG_UNSIGNED); + sampleStream = Audio::makeRawMemoryStream(sampleBuf, sampleLen, 22050, Audio::FLAG_UNSIGNED); break; } if (sampleStream) { diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index deacf515b5..a75f2172a6 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -599,7 +599,7 @@ Audio::RewindableAudioStream *AnimationSequencePlayer::loadSound(int index, Anim uint8 *sampleData = (uint8 *)malloc(size); if (sampleData) { f.read(sampleData, size); - stream = Audio::makeRawMemoryStream(sampleData, size, DisposeAfterUse::YES, rate, flags); + stream = Audio::makeRawMemoryStream(sampleData, size, rate, flags); } } break; -- cgit v1.2.3