diff options
Diffstat (limited to 'engines')
37 files changed, 132 insertions, 116 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 4309b57089..4c1b4ee790 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -252,7 +252,7 @@ Audio::AudioStream *WavSound::makeAudioStream(uint sound) { void WavSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { convertVolume(vol); - _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol); + _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::FLAG_LOOP) != 0), -1, vol); } Audio::AudioStream *VocSound::makeAudioStream(uint sound) { @@ -263,7 +263,7 @@ Audio::AudioStream *VocSound::makeAudioStream(uint sound) { void VocSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { convertVolume(vol); _flags = flags; - _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol); + _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::FLAG_LOOP) != 0), -1, vol); } void RawSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { @@ -308,7 +308,7 @@ Audio::AudioStream *MP3Sound::makeAudioStream(uint sound) { void MP3Sound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { convertVolume(vol); - _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol); + _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::FLAG_LOOP) != 0), -1, vol); } #endif @@ -339,7 +339,7 @@ Audio::AudioStream *VorbisSound::makeAudioStream(uint sound) { void VorbisSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { convertVolume(vol); - _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol); + _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::FLAG_LOOP) != 0), -1, vol); } #endif @@ -370,7 +370,7 @@ Audio::AudioStream *FlacSound::makeAudioStream(uint sound) { void FlacSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) { convertVolume(vol); - _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol); + _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::FLAG_LOOP) != 0), -1, vol); } #endif @@ -616,13 +616,13 @@ void Sound::playVoice(uint sound) { _mixer->stopHandle(_voiceHandle); if (_vm->getGameType() == GType_PP) { if (sound < 11) - _voice->playSound(sound, sound + 1, Audio::Mixer::kMusicSoundType, &_voiceHandle, Audio::Mixer::FLAG_LOOP, -1500); + _voice->playSound(sound, sound + 1, Audio::Mixer::kMusicSoundType, &_voiceHandle, Audio::FLAG_LOOP, -1500); else - _voice->playSound(sound, sound, Audio::Mixer::kMusicSoundType, &_voiceHandle, Audio::Mixer::FLAG_LOOP); + _voice->playSound(sound, sound, Audio::Mixer::kMusicSoundType, &_voiceHandle, Audio::FLAG_LOOP); } else if (_vm->getGameType() == GType_FF || _vm->getGameId() == GID_SIMON1CD32) { _voice->playSound(sound, Audio::Mixer::kSpeechSoundType, &_voiceHandle, 0); } else { - _voice->playSound(sound, Audio::Mixer::kSpeechSoundType, &_voiceHandle, Audio::Mixer::FLAG_UNSIGNED); + _voice->playSound(sound, Audio::Mixer::kSpeechSoundType, &_voiceHandle, Audio::FLAG_UNSIGNED); } } @@ -635,7 +635,7 @@ void Sound::playEffects(uint sound) { if (_vm->getGameType() == GType_SIMON1) _mixer->stopHandle(_effectsHandle); - _effects->playSound(sound, Audio::Mixer::kSFXSoundType, &_effectsHandle, (_vm->getGameId() == GID_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED); + _effects->playSound(sound, Audio::Mixer::kSFXSoundType, &_effectsHandle, (_vm->getGameId() == GID_SIMON1CD32) ? 0 : Audio::FLAG_UNSIGNED); } void Sound::playAmbient(uint sound) { @@ -651,7 +651,7 @@ void Sound::playAmbient(uint sound) { return; _mixer->stopHandle(_ambientHandle); - _effects->playSound(sound, Audio::Mixer::kSFXSoundType, &_ambientHandle, Audio::Mixer::FLAG_LOOP | Audio::Mixer::FLAG_UNSIGNED); + _effects->playSound(sound, Audio::Mixer::kSFXSoundType, &_ambientHandle, Audio::FLAG_LOOP | Audio::FLAG_UNSIGNED); } bool Sound::hasVoice() const { @@ -743,7 +743,7 @@ void Sound::playRawData(byte *soundData, uint sound, uint size, uint freq) { byte flags = 0; if (_vm->getPlatform() == Common::kPlatformPC) - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; Audio::AudioStream *stream = Audio::makeRawMemoryStream(buffer, size, DisposeAfterUse::YES, freq, flags); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_effectsHandle, stream); diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index 4617cd5c6f..88421abe97 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -195,10 +195,10 @@ SndHandle *Sound::getHandle() { void Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffer, int volume, sndHandleType handleType, bool loop) { - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; if (loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; const Audio::Mixer::SoundType soundType = (handleType == kVoiceHandle) ? Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 2b5e9c101b..9c17a77216 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -186,7 +186,7 @@ void DrasculaEngine::playFile(const char *fname) { memset(soundData, 0x80, soundSize); // Mute speech but keep the pause Audio::AudioStream *stream = Audio::makeRawMemoryStream(soundData, soundSize - 64, DisposeAfterUse::YES, - 11025, Audio::Mixer::FLAG_UNSIGNED); + 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, stream); } else warning("playFile: Could not open %s", fname); diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index e8045d21f7..6cd55678cf 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -26,6 +26,7 @@ #include "common/util.h" #include "common/stream.h" #include "sound/mixer.h" +#include "sound/raw.h" #include "sound/wave.h" #include "gob/sound/sounddesc.h" @@ -120,7 +121,7 @@ void SoundDesc::convToSigned() { if (!_data || !_dataPtr) return; - if (_mixerFlags & Audio::Mixer::FLAG_16BITS) { + if (_mixerFlags & Audio::FLAG_16BITS) { byte *data = _dataPtr; for (uint32 i = 0; i < _size; i++, data += 2) WRITE_LE_UINT16(data, READ_LE_UINT16(data) ^ 0x8000); @@ -163,12 +164,12 @@ bool SoundDesc::loadWAV(byte *data, uint32 dSize) { if (!Audio::loadWAVFromStream(stream, wavSize, wavRate, wavFlags, &wavtype, 0)) return false; - if (wavFlags & Audio::Mixer::FLAG_16BITS) { - _mixerFlags |= Audio::Mixer::FLAG_16BITS; + if (wavFlags & Audio::FLAG_16BITS) { + _mixerFlags |= Audio::FLAG_16BITS; wavSize >>= 1; } - if (wavFlags & Audio::Mixer::FLAG_STEREO) { + if (wavFlags & Audio::FLAG_STEREO) { warning("TODO: SoundDesc::loadWAV() - stereo"); return false; } @@ -178,7 +179,7 @@ bool SoundDesc::loadWAV(byte *data, uint32 dSize) { _size = wavSize; _frequency = wavRate; - if (wavFlags & Audio::Mixer::FLAG_UNSIGNED) + if (wavFlags & Audio::FLAG_UNSIGNED) convToSigned(); return true; diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp index bf7d85d544..0feefb8af4 100644 --- a/engines/gob/sound/soundmixer.cpp +++ b/engines/gob/sound/soundmixer.cpp @@ -26,6 +26,8 @@ #include "gob/sound/soundmixer.h" #include "gob/sound/sounddesc.h" +#include "sound/raw.h" + namespace Gob { SoundMixer::SoundMixer(Audio::Mixer &mixer, Audio::Mixer::SoundType type) : _mixer(&mixer) { @@ -105,7 +107,7 @@ void SoundMixer::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency, sndDesc._repCount = repCount - 1; sndDesc._frequency = frequency; - _16bit = (sndDesc._mixerFlags & Audio::Mixer::FLAG_16BITS) != 0; + _16bit = (sndDesc._mixerFlags & Audio::FLAG_16BITS) != 0; _data = sndDesc.getData(); diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 5887ccbf22..937e2b4e91 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -36,6 +36,7 @@ #include "graphics/conversion.h" #endif #include "sound/mixer.h" +#include "sound/raw.h" namespace Groovie { @@ -540,9 +541,9 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } // Queue the read buffer - byte flags = Audio::Mixer::FLAG_16BITS; + byte flags = Audio::FLAG_16BITS; #ifdef SCUMM_LITTLE_ENDIAN - flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + flags |= Audio::FLAG_LITTLE_ENDIAN; #endif _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags); @@ -596,9 +597,9 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } // Queue the read buffer - byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_STEREO; + byte flags = Audio::FLAG_16BITS | Audio::FLAG_STEREO; #ifdef SCUMM_LITTLE_ENDIAN - flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + flags |= Audio::FLAG_LITTLE_ENDIAN; #endif _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags); diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index b41e28747a..cef70e77b6 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -28,6 +28,7 @@ #include "groovie/vdx.h" #include "sound/mixer.h" +#include "sound/raw.h" #define TILE_SIZE 4 // Size of each tile on the image: only ever seen 4 so far #define VDX_IDENT 0x9267 // 37479 @@ -506,7 +507,7 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { byte *data = (byte *)malloc(60000); int chunksize = in->read(data, 60000); if (!Common::isDebugChannelEnabled(kGroovieDebugFast)) { - _audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } } diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index e75c6e0033..d9058a5dc3 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -34,9 +34,10 @@ #include "sound/voc.h" #include "sound/audiostream.h" +#include "sound/flac.h" #include "sound/mp3.h" +#include "sound/raw.h" #include "sound/vorbis.h" -#include "sound/flac.h" namespace Kyra { @@ -244,9 +245,9 @@ namespace { Audio::SeekableAudioStream *makeVOCStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse) { #ifdef STREAM_AUDIO_FROM_DISK - Audio::SeekableAudioStream *as = Audio::makeVOCStream(*stream, Audio::Mixer::FLAG_UNSIGNED, disposeAfterUse); + Audio::SeekableAudioStream *as = Audio::makeVOCStream(*stream, Audio::FLAG_UNSIGNED, disposeAfterUse); #else - Audio::SeekableAudioStream *as = Audio::makeVOCStream(*stream, Audio::Mixer::FLAG_UNSIGNED, DisposeAfterUse::NO); + Audio::SeekableAudioStream *as = Audio::makeVOCStream(*stream, Audio::FLAG_UNSIGNED, DisposeAfterUse::NO); if (disposeAfterUse) delete stream; diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 061893a452..9628ed1da9 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -3926,7 +3926,7 @@ void SoundTowns::playSoundEffect(uint8 track) { uint32 outputRate = uint32(11025 * calculatePhaseStep(note, sfxRootNoteOffs, sfxRate, 11025, 0x2000)); _currentSFX = Audio::makeRawMemoryStream(sfxPlaybackBuffer, playbackBufferSize, DisposeAfterUse::YES, - outputRate, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LITTLE_ENDIAN, 0, 0); + outputRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, 0, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, _currentSFX); } @@ -4298,7 +4298,7 @@ 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::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LITTLE_ENDIAN, 0, 0); + Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, 0, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h], _currentSFX); if (handle) *handle = _soundChannels[h]; diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 69d63b60f2..6ef591fae8 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -37,6 +37,7 @@ #include "common/system.h" #include "sound/audiostream.h" #include "sound/mixer.h" +#include "sound/raw.h" #include "kyra/sound.h" #include "kyra/screen.h" @@ -422,7 +423,7 @@ void VQAMovie::displayFrame(uint frameNum) { inbuf = (byte *)malloc(size); _file->read(inbuf, size); assert(_stream); - _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); break; case MKID_BE('SND1'): // Compressed sound, almost like AUD @@ -435,12 +436,12 @@ void VQAMovie::displayFrame(uint frameNum) { if (insize == outsize) { assert(_stream); - _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } else { outbuf = (byte *)malloc(outsize); decodeSND1(inbuf, insize, outbuf, outsize); assert(_stream); - _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); free(inbuf); } break; @@ -612,7 +613,7 @@ void VQAMovie::play() { case MKID_BE('SND0'): // Uncompressed sound inbuf = (byte *)malloc(size); _file->read(inbuf, size); - _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); break; case MKID_BE('SND1'): // Compressed sound @@ -623,11 +624,11 @@ void VQAMovie::play() { _file->read(inbuf, insize); if (insize == outsize) { - _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } else { outbuf = (byte *)malloc(outsize); decodeSND1(inbuf, insize, outbuf, outsize); - _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); free(inbuf); } break; diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index e9e1726dc3..cf2f54fb9a 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -90,10 +90,10 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel) _vm->res()->toss(soundName); handle->type = kEffectHandle; - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; if (loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; _vm->res()->toss(soundName); @@ -146,7 +146,7 @@ void Sound::playVoice(const char *soundName, int volume) { soundStream->read(buffer, soundStream->size()); handle->type = kEffectHandle; - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; _vm->res()->toss(soundName); @@ -250,10 +250,10 @@ void Sound::playDSRSound(int soundIndex, int volume, bool loop) { SndHandle *handle = getHandle(); handle->type = kEffectHandle; - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; if (loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; // Get sound data FabDecompressor fab; diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp index f65678c510..5e96fdc206 100644 --- a/engines/made/pmvplayer.cpp +++ b/engines/made/pmvplayer.cpp @@ -26,6 +26,8 @@ #include "made/pmvplayer.h" #include "made/screen.h" +#include "sound/raw.h" + namespace Made { PmvPlayer::PmvPlayer(MadeEngine *vm, Audio::Mixer *mixer) : _fd(NULL), _vm(vm), _mixer(mixer) { @@ -140,7 +142,7 @@ bool PmvPlayer::play(const char *filename) { soundSize = chunkCount * chunkSize; soundData = (byte *)malloc(soundSize); decompressSound(audioData + 8, soundData, chunkSize, chunkCount); - _audioStream->queueBuffer(soundData, soundSize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); + _audioStream->queueBuffer(soundData, soundSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } // Handle palette diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index 7edddbb644..b29e1b8fb0 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -261,9 +261,9 @@ void SoundResource::load(byte *source, int size) { } Audio::AudioStream *SoundResource::getAudioStream(int soundRate, bool loop) { - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; if (loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; return Audio::makeRawMemoryStream(_soundData, _soundSize, DisposeAfterUse::NO, soundRate, flags, 0, 0); } diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 33bc71e8bf..e0b95c96e0 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -435,11 +435,11 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre // The sound in the CD version of Riven is encoded in Intel DVI ADPCM // The sound in the DVD version of Riven is encoded in MPEG-2 Layer II or Intel DVI ADPCM if (data_chunk.encoding == kCodecRaw) { - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; if (data_chunk.channels == 2) - flags |= Audio::Mixer::FLAG_STEREO; + flags |= Audio::FLAG_STEREO; if (data_chunk.loop == 0xFFFF || loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; return Audio::makeRawMemoryStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES, data_chunk.sample_rate, flags, data_chunk.loopStart, data_chunk.loopEnd); } else if (data_chunk.encoding == kCodecADPCM) { Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES); @@ -481,10 +481,10 @@ Audio::AudioStream *Sound::makeOldMohawkWaveStream(Common::SeekableReadStream *s stream->read(data, size); delete stream; - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; if (loop) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; return Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, rate, flags, 0, 0); } diff --git a/engines/mohawk/video/qt_player.cpp b/engines/mohawk/video/qt_player.cpp index 4ddb8d2ee8..e53818fe2e 100644 --- a/engines/mohawk/video/qt_player.cpp +++ b/engines/mohawk/video/qt_player.cpp @@ -1161,11 +1161,11 @@ Audio::AudioStream *QTPlayer::createAudioStream(Common::SeekableReadStream *stre // Fortunately, most of the audio used in Myst videos is raw... uint16 flags = 0; if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('raw ')) - flags |= Audio::Mixer::FLAG_UNSIGNED; + flags |= Audio::FLAG_UNSIGNED; if (_streams[_audioStreamIndex]->channels == 2) - flags |= Audio::Mixer::FLAG_STEREO; + flags |= Audio::FLAG_STEREO; if (_streams[_audioStreamIndex]->bits_per_sample == 16) - flags |= Audio::Mixer::FLAG_16BITS; + flags |= Audio::FLAG_16BITS; uint32 dataSize = stream->size(); byte *data = (byte *)malloc(dataSize); stream->read(data, dataSize); diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index 5dfbf742c0..b4d5fa37ec 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -416,11 +416,11 @@ Audio::AudioStream *DosSoundMan_br::loadChannelData(const char *filename, Channe int rate = 11025; uint32 loopStart = 0, loopEnd = 0; - uint32 flags = Audio::Mixer::FLAG_UNSIGNED; + uint32 flags = Audio::FLAG_UNSIGNED; if (looping) { loopEnd = dataSize; - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; } ch->stream = Audio::makeRawMemoryStream((byte *)data, dataSize, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index 71467b9f99..089a2ac379 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::Mixer::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, 11840, Audio::FLAG_UNSIGNED); _mixer->playInputStream(type, soundHandle, stream); } } diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 70b62dbd02..6d8eb1cff1 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -304,8 +304,8 @@ void Music::play(uint32 resourceId, MusicFlags flags) { (uint32)resData->offset + offs, (uint32)resData->offset + resData->size - offs); if (!_digitalMusicContext->isCompressed()) { - byte musicFlags = Audio::Mixer::FLAG_STEREO | - Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN; + byte musicFlags = Audio::FLAG_STEREO | + Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN; Audio::RawDiskStreamAudioBlock audioBlocks[1]; audioBlocks[0].pos = 0; audioBlocks[0].len = resData->size / 2; // 16-bit sound diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 05dd6219a1..2a87df6711 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -34,14 +34,15 @@ #include "common/file.h" -#include "sound/voc.h" -#include "sound/wave.h" +#include "sound/audiostream.h" #include "sound/adpcm.h" #include "sound/aiff.h" #ifdef ENABLE_SAGA2 #include "sound/shorten.h" #endif -#include "sound/audiostream.h" +#include "sound/raw.h" +#include "sound/voc.h" +#include "sound/wave.h" namespace Saga { @@ -268,12 +269,12 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff buffer.soundType = resourceType; buffer.originalSize = 0; // Set default flags and frequency for PCM, VOC and VOX files, which got no header - buffer.flags = Audio::Mixer::FLAG_16BITS; + buffer.flags = Audio::FLAG_16BITS; buffer.frequency = 22050; if (_vm->getGameId() == GID_ITE) { if (_vm->getFeatures() & GF_8BIT_UNSIGNED_PCM) { // older ITE demos - buffer.flags |= Audio::Mixer::FLAG_UNSIGNED; - buffer.flags &= ~Audio::Mixer::FLAG_16BITS; + buffer.flags |= Audio::FLAG_UNSIGNED; + buffer.flags &= ~Audio::FLAG_16BITS; } else { // Voice files in newer ITE demo versions are OKI ADPCM (VOX) encoded if (!scumm_stricmp(context->fileName(), "voicesd.rsc")) @@ -284,9 +285,9 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff // Check for LE sounds if (!context->isBigEndian()) - buffer.flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + buffer.flags |= Audio::FLAG_LITTLE_ENDIAN; if ((context->fileType() & GAME_VOICEFILE) && (_vm->getFeatures() & GF_LE_VOICES)) - buffer.flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + buffer.flags |= Audio::FLAG_LITTLE_ENDIAN; // Older Mac versions of ITE were Macbinary packed int soundOffset = (context->fileType() & GAME_MACBINARY) ? 36 : 0; @@ -329,7 +330,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff result = (data != 0); if (onlyHeader) free(data); - buffer.flags |= Audio::Mixer::FLAG_UNSIGNED; + buffer.flags |= Audio::FLAG_UNSIGNED; } if (result) { @@ -355,9 +356,9 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff buffer.frequency = readS.readUint16LE(); buffer.originalSize = readS.readUint32LE(); if (readS.readByte() == 8) // read sample bits - buffer.flags &= ~Audio::Mixer::FLAG_16BITS; + buffer.flags &= ~Audio::FLAG_16BITS; if (readS.readByte() != 0) // read stereo flag - buffer.flags |= Audio::Mixer::FLAG_STEREO; + buffer.flags |= Audio::FLAG_STEREO; buffer.size = soundResourceLength; buffer.soundType = resourceType; @@ -404,10 +405,10 @@ int SndRes::getVoiceLength(uint32 resourceId) { else msDouble = (double)buffer.originalSize; - if (buffer.flags & Audio::Mixer::FLAG_16BITS) + if (buffer.flags & Audio::FLAG_16BITS) msDouble /= 2.0; - if (buffer.flags & Audio::Mixer::FLAG_STEREO) + if (buffer.flags & Audio::FLAG_STEREO) msDouble /= 2.0; msDouble = msDouble / buffer.frequency * 1000.0; diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 75b5c61ad9..39867c9f37 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -70,7 +70,7 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int Audio::AudioStream *stream = 0; if (loop) - buffer.flags |= Audio::Mixer::FLAG_LOOP; + buffer.flags |= Audio::FLAG_LOOP; Audio::Mixer::SoundType soundType = (handleType == kVoiceHandle) ? Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType; diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index bdb8c165f6..d2986a301b 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -170,10 +170,10 @@ static byte *readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size, // Convert the SOL stream flags to our own format flags = 0; if (audioFlags & kSolFlag16Bit) - flags |= Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN; + flags |= Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN; if (!(audioFlags & kSolFlagIsSigned)) - flags |= Audio::Mixer::FLAG_UNSIGNED; + flags |= Audio::FLAG_UNSIGNED; if (audioFlags & kSolFlagCompressed) { buffer = (byte *)malloc(size * 2); @@ -240,7 +240,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 data = (byte *)malloc(size); assert(data); memcpy(data, audioRes->data, size); - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; } } @@ -248,7 +248,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 audioStream = Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, _audioRate, flags); if (audioStream) { - *sampleLen = (flags & Audio::Mixer::FLAG_16BITS ? size >> 1 : size) * 60 / _audioRate; + *sampleLen = (flags & Audio::FLAG_16BITS ? size >> 1 : size) * 60 / _audioRate; return audioStream; } diff --git a/engines/sci/sound/iterator/iterator.cpp b/engines/sci/sound/iterator/iterator.cpp index 5cb5f2d321..2c54b0bdee 100644 --- a/engines/sci/sound/iterator/iterator.cpp +++ b/engines/sci/sound/iterator/iterator.cpp @@ -551,7 +551,7 @@ static Audio::AudioStream *makeStream(byte *data, int size, int rate) { memcpy(sound, data, size); // Convert stream format flags - int flags = Audio::Mixer::FLAG_UNSIGNED; + int flags = Audio::FLAG_UNSIGNED; return Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, flags, 0, 0); } diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 65d3d2cd16..d96fdcbe70 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -165,7 +165,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { if (track->digitalChannelNr != -1) { byte *channelData = track->channels[track->digitalChannelNr].data; delete pSnd->pStreamAud; - pSnd->pStreamAud = Audio::makeRawMemoryStream(channelData, track->digitalSampleSize, DisposeAfterUse::NO, track->digitalSampleRate, Audio::Mixer::FLAG_UNSIGNED); + pSnd->pStreamAud = Audio::makeRawMemoryStream(channelData, track->digitalSampleSize, DisposeAfterUse::NO, track->digitalSampleRate, Audio::FLAG_UNSIGNED); 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 ea8f9e9f8a..fcf3c5477e 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -169,10 +169,10 @@ void CUP_Player::updateSfx() { uint8 *soundData = _sfxBuffer + offset; if (READ_BE_UINT32(soundData) == MKID_BE('DATA')) { uint32 soundSize = READ_BE_UINT32(soundData + 4); - uint32 flags = Audio::Mixer::FLAG_UNSIGNED; + uint32 flags = Audio::FLAG_UNSIGNED; uint32 loopEnd = 0; if (sfx->flags & kSfxFlagLoop) { - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; loopEnd = soundSize - 8; } _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &sfxChannel->handle, diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 64487568c3..5b19322290 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -532,7 +532,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) byte *ptr, *spoolPtr; int size = -1; int priority, rate; - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType; if (soundID > _vm->_numSounds) @@ -636,7 +636,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) // TODO: Extra sound flags if (heFlags & 1) { - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; _heChannel[heChannel].timer = 0; } else { _heChannel[heChannel].timer = size * 1000 / rate; @@ -644,7 +644,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) _mixer->stopHandle(_heSoundChannels[heChannel]); if (compType == 17) { - Audio::AudioStream *voxStream = Audio::makeADPCMStream(&memStream, false, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign); + Audio::AudioStream *voxStream = Audio::makeADPCMStream(&memStream, false, size, Audio::kADPCMMSIma, rate, (flags & Audio::FLAG_STEREO) ? 2 : 1, blockAlign); // FIXME: Get rid of this crude hack to turn a ADPCM stream into a raw stream. // It seems it is only there to allow looping -- if that is true, we certainly @@ -666,7 +666,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) // makeADPCMStream returns a stream in native endianness, but RawMemoryStream // defaults to big endian. If we're on a little endian system, set the LE flag. #ifdef SCUMM_LITTLE_ENDIAN - flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + flags |= Audio::FLAG_LITTLE_ENDIAN; #endif stream = Audio::makeRawMemoryStream(sound + heOffset, size - heOffset, DisposeAfterUse::YES, rate, flags, 0, 0); } else { @@ -722,7 +722,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) // TODO: Extra sound flags if (heFlags & 1) { - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; _heChannel[heChannel].timer = 0; } else { _heChannel[heChannel].timer = size * 1000 / rate; diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 43c72bc7ad..55fc66f058 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -35,6 +35,7 @@ #include "sound/audiostream.h" #include "sound/mixer.h" +#include "sound/raw.h" namespace Scumm { @@ -78,13 +79,13 @@ IMuseDigital::~IMuseDigital() { int32 IMuseDigital::makeMixerFlags(int32 flags) { int32 mixerFlags = 0; if (flags & kFlagUnsigned) - mixerFlags |= Audio::Mixer::FLAG_UNSIGNED; + mixerFlags |= Audio::FLAG_UNSIGNED; if (flags & kFlag16Bits) - mixerFlags |= Audio::Mixer::FLAG_16BITS; + mixerFlags |= Audio::FLAG_16BITS; if (flags & kFlagLittleEndian) - mixerFlags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; + mixerFlags |= Audio::FLAG_LITTLE_ENDIAN; if (flags & kFlagStereo) - mixerFlags |= Audio::Mixer::FLAG_STEREO; + mixerFlags |= Audio::FLAG_STEREO; return mixerFlags; } diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index 4e878768ef..9364ce0ee5 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((const byte*)data, size, DisposeAfterUse::YES, rate, (loopStart != loopEnd ? Audio::Mixer::FLAG_LOOP : 0), loopStart, loopEnd); + _channels[i].input = Audio::makeRawMemoryStream((const byte*)data, size, DisposeAfterUse::YES, rate, (loopStart != loopEnd ? Audio::FLAG_LOOP : 0), loopStart, loopEnd); // read the first sample _channels[i].input->readBuffer(&_channels[i].pos, 1); } diff --git a/engines/scumm/smush/smush_mixer.cpp b/engines/scumm/smush/smush_mixer.cpp index a9b5e6077e..33285c7626 100644 --- a/engines/scumm/smush/smush_mixer.cpp +++ b/engines/scumm/smush/smush_mixer.cpp @@ -33,6 +33,7 @@ #include "scumm/imuse/imuse.h" #include "sound/mixer.h" +#include "sound/raw.h" namespace Scumm { @@ -112,11 +113,11 @@ bool SmushMixer::handleFrame() { int32 size = _channels[i].chan->getAvailableSoundDataSize(); byte *data = _channels[i].chan->getSoundData(); - byte flags = stereo ? Audio::Mixer::FLAG_STEREO : 0; + byte flags = stereo ? Audio::FLAG_STEREO : 0; if (is_16bit) { - flags |= Audio::Mixer::FLAG_16BITS; + flags |= Audio::FLAG_16BITS; } else { - flags |= Audio::Mixer::FLAG_UNSIGNED; + flags |= Audio::FLAG_UNSIGNED; } if (_mixer->isReady()) { diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 871ce76803..e8470aaf04 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -50,8 +50,9 @@ #include "scumm/insane/insane.h" #include "sound/mixer.h" -#include "sound/vorbis.h" #include "sound/mp3.h" +#include "sound/raw.h" +#include "sound/vorbis.h" #include "common/zlib.h" @@ -472,7 +473,7 @@ void SmushPlayer::handleIACT(int32 subSize, Common::SeekableReadStream &b) { _IACTstream = Audio::makeQueuingAudioStream(22050, true); _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_IACTchannel, _IACTstream); } - _IACTstream->queueBuffer(output_data, 0x1000, DisposeAfterUse::YES, Audio::Mixer::FLAG_STEREO | Audio::Mixer::FLAG_16BITS); + _IACTstream->queueBuffer(output_data, 0x1000, DisposeAfterUse::YES, Audio::FLAG_STEREO | Audio::FLAG_16BITS); bsize -= len; d_src += len; diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 788be2d0d6..988be35af8 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -164,7 +164,7 @@ void Sound::playSound(int soundID) { Audio::AudioStream *stream; int size = -1; int rate; - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) { if (soundID >= 13 && soundID <= 32) { @@ -351,7 +351,7 @@ void Sound::playSound(int soundID) { size -= waveSize; if (loopEnd > 0) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; stream = Audio::makeRawMemoryStream(sound, waveSize, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); @@ -442,7 +442,7 @@ void Sound::playSound(int soundID) { // so maybe this is not really a problem. loopStart = READ_BE_UINT16(ptr + 10) - READ_BE_UINT16(ptr + 8); loopEnd = READ_BE_UINT16(ptr + 14); - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; } memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size); @@ -659,7 +659,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle #endif break; default: - input = Audio::makeVOCStream(*_sfxFile, Audio::Mixer::FLAG_UNSIGNED); + input = Audio::makeVOCStream(*_sfxFile, Audio::FLAG_UNSIGNED); break; } diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index a81058692d..d5318d66f1 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -740,7 +740,7 @@ bool Intro::nextPart(uint16 *&data) { memset(vData, 127, sizeof(DataFileHeader)); stream = Audio::makeRawMemoryStream(vData, _skyDisk->_lastLoadedFileSize, DisposeAfterUse::YES, - 11025, Audio::Mixer::FLAG_UNSIGNED); + 11025, Audio::FLAG_UNSIGNED); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_voice, stream, SOUND_VOICE); return true; case WAITVOICE: @@ -757,13 +757,13 @@ bool Intro::nextPart(uint16 *&data) { case LOOPBG: _mixer->stopID(SOUND_BG); stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, DisposeAfterUse::YES, - 11025, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LOOP, 0, 0); + 11025, Audio::FLAG_UNSIGNED | Audio::FLAG_LOOP, 0, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSfx, stream, SOUND_BG); return true; case PLAYBG: _mixer->stopID(SOUND_BG); stream = Audio::makeRawMemoryStream(_bgBuf + 256, _bgSize - 768, DisposeAfterUse::YES, - 11025, Audio::Mixer::FLAG_UNSIGNED); + 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 83ddc11a6b..1b7fd8fa50 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -1038,7 +1038,7 @@ Sound::~Sound() { void Sound::playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *handle) { byte flags = 0; - flags |= Audio::Mixer::FLAG_UNSIGNED; + flags |= Audio::FLAG_UNSIGNED; size -= sizeof(DataFileHeader); byte *buffer = (byte *)malloc(size); memcpy(buffer, sound+sizeof(DataFileHeader), size); @@ -1111,13 +1111,13 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) { uint32 dataLoop = READ_BE_UINT16(_sfxInfo + (sound << 3) + 6); dataOfs += _sfxBaseOfs; - byte flags = Audio::Mixer::FLAG_UNSIGNED; + byte flags = Audio::FLAG_UNSIGNED; uint32 loopSta = 0, loopEnd = 0; if (dataLoop) { loopSta = dataSize - dataLoop; loopEnd = dataSize; - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; } @@ -1249,7 +1249,7 @@ bool Sound::startSpeech(uint16 textNum) { _mixer->stopID(SOUND_SPEECH); - Audio::AudioStream *stream = Audio::makeRawMemoryStream(playBuffer, speechSize, DisposeAfterUse::YES, rate, Audio::Mixer::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeRawMemoryStream(playBuffer, speechSize, DisposeAfterUse::YES, 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 d50e673bdd..5840b165e5 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -46,7 +46,7 @@ namespace Sword1 { #define SOUND_SPEECH_ID 1 -#define SPEECH_FLAGS (Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN) +#define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN) Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) { g_eventRec.registerRandomSource(_rnd, "sword1sound"); @@ -265,13 +265,13 @@ void Sound::playSample(QueueElement *elem) { uint32 size = READ_LE_UINT32(sampleData + 0x28); uint8 flags; if (READ_LE_UINT16(sampleData + 0x22) == 16) - flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN; + flags = Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN; else - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; if (READ_LE_UINT16(sampleData + 0x16) == 2) - flags |= Audio::Mixer::FLAG_STEREO; + flags |= Audio::FLAG_STEREO; if (_fxList[elem->id].type == FX_LOOP) - flags |= Audio::Mixer::FLAG_LOOP; + flags |= Audio::FLAG_LOOP; Audio::AudioStream *stream = Audio::makeRawMemoryStream(sampleData + 0x2C, size, DisposeAfterUse::NO, 11025, flags, 0, 0); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &elem->handle, stream, elem->id, volume, pan); } diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index 50a0d5193c..0324fdb5b9 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -42,6 +42,8 @@ #include "tinsel/tinlib.h" #include "tinsel/tinsel.h" +#include "sound/raw.h" + namespace Tinsel { //----------------- LOCAL DEFINES ---------------------------- @@ -453,7 +455,7 @@ void BMVPlayer::MovieAudio(int audioOffset, int blobs) { else memset(data, 0, blobs * 128); - _audioStream->queueBuffer(data, blobs * 128, DisposeAfterUse::YES, Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_STEREO); + _audioStream->queueBuffer(data, blobs * 128, DisposeAfterUse::YES, Audio::FLAG_16BITS | Audio::FLAG_STEREO); if (currentSoundFrame == ADVANCE_SOUND) { if (!audioStarted) { diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index 64c89dcd22..e636458032 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::Mixer::FLAG_UNSIGNED); + sampleStream = Audio::makeRawMemoryStream(sampleBuf, sampleLen, DisposeAfterUse::YES, 22050, Audio::FLAG_UNSIGNED); break; } if (sampleStream) { diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 1a9889c307..b56103ca03 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -30,6 +30,7 @@ #include "sound/mp3.h" #include "sound/voc.h" #include "sound/vorbis.h" +#include "sound/raw.h" #include "sound/audiostream.h" #include "touche/midi.h" @@ -587,7 +588,7 @@ void ToucheEngine::res_loadSound(int priority, int num) { uint32 size; const uint32 offs = res_getDataOffset(kResourceTypeSound, num, &size); _fData.seek(offs); - Audio::AudioStream *stream = Audio::makeVOCStream(_fData, Audio::Mixer::FLAG_UNSIGNED); + Audio::AudioStream *stream = Audio::makeVOCStream(_fData, Audio::FLAG_UNSIGNED); if (stream) { _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, stream); } @@ -645,7 +646,7 @@ void ToucheEngine::res_loadSpeechSegment(int num) { return; } _fSpeech[i].seek(offs); - stream = Audio::makeVOCStream(_fSpeech[i], Audio::Mixer::FLAG_UNSIGNED); + stream = Audio::makeVOCStream(_fSpeech[i], Audio::FLAG_UNSIGNED); } else { if (num >= 750) { num -= 750; diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 19041a33c4..deacf515b5 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -591,9 +591,9 @@ Audio::RewindableAudioStream *AnimationSequencePlayer::loadSound(int index, Anim case kAnimationSoundType16BitsRAW: size = f.size(); rate = 22050; - flags = Audio::Mixer::FLAG_UNSIGNED; + flags = Audio::FLAG_UNSIGNED; if (type == kAnimationSoundType16BitsRAW) - flags = Audio::Mixer::FLAG_LITTLE_ENDIAN | Audio::Mixer::FLAG_16BITS; + flags = Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS; if (size != 0) { uint8 *sampleData = (uint8 *)malloc(size); |