AUDIO: Remove default rate parameter from xa

This commit is contained in:
Matthew Hoops 2011-08-24 09:47:24 -04:00
parent adb69a5a39
commit 40fd9ce27c
5 changed files with 7 additions and 7 deletions

View file

@ -49,7 +49,7 @@ class RewindableAudioStream;
*/ */
RewindableAudioStream *makeXAStream( RewindableAudioStream *makeXAStream(
Common::SeekableReadStream *stream, Common::SeekableReadStream *stream,
int rate = 11025); int rate);
} // End of namespace Audio } // End of namespace Audio

View file

@ -131,7 +131,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) {
// not over file size // not over file size
if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) { if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) {
_file.seek(offset, SEEK_SET); _file.seek(offset, SEEK_SET);
_audioSource = Audio::makeLoopingAudioStream(Audio::makeXAStream(_file.readStream(size)), loop ? 0 : 1); _audioSource = Audio::makeLoopingAudioStream(Audio::makeXAStream(_file.readStream(size), 11025), loop ? 0 : 1);
fadeUp(); fadeUp();
} else { } else {
_audioSource = NULL; _audioSource = NULL;

View file

@ -256,7 +256,7 @@ void Sound::playSample(QueueElement *elem) {
if (SwordEngine::isPsx()) { if (SwordEngine::isPsx()) {
uint32 size = READ_LE_UINT32(sampleData); uint32 size = READ_LE_UINT32(sampleData);
Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(Audio::makeXAStream(new Common::MemoryReadStream(sampleData + 4, size-4)), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1); Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(Audio::makeXAStream(new Common::MemoryReadStream(sampleData + 4, size-4), 11025), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1);
_mixer->playStream(Audio::Mixer::kSFXSoundType, &elem->handle, audStream, elem->id, volume, pan); _mixer->playStream(Audio::Mixer::kSFXSoundType, &elem->handle, audStream, elem->id, volume, pan);
} else { } else {
uint32 size = READ_LE_UINT32(sampleData + 0x28); uint32 size = READ_LE_UINT32(sampleData + 0x28);
@ -364,7 +364,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
_cowFile.seek(index * 2048); _cowFile.seek(index * 2048);
Common::SeekableReadStream *tmp = _cowFile.readStream(sampleSize); Common::SeekableReadStream *tmp = _cowFile.readStream(sampleSize);
assert(tmp); assert(tmp);
stream = Audio::makeXAStream(tmp); stream = Audio::makeXAStream(tmp, 11025);
_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream, SOUND_SPEECH_ID, speechVol, speechPan); _mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream, SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume. // with compressed audio, we can't calculate the wave volume.
// so default to talking. // so default to talking.

View file

@ -267,7 +267,7 @@ Audio::AudioStream *makePSXCLUStream(Common::File *file, int size) {
byte *buffer = (byte *)malloc(size); byte *buffer = (byte *)malloc(size);
file->read(buffer, size); file->read(buffer, size);
return Audio::makeXAStream(new Common::MemoryReadStream(buffer, size, DisposeAfterUse::YES)); return Audio::makeXAStream(new Common::MemoryReadStream(buffer, size, DisposeAfterUse::YES), 11025);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View file

@ -234,7 +234,7 @@ void Sound::playMovieSound(int32 res, int type) {
Audio::RewindableAudioStream *input = 0; Audio::RewindableAudioStream *input = 0;
if (Sword2Engine::isPsx()) { if (Sword2Engine::isPsx()) {
input = Audio::makeXAStream(stream); input = Audio::makeXAStream(stream, 11025);
} else { } else {
input = Audio::makeWAVStream(stream, DisposeAfterUse::YES); input = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
} }
@ -361,7 +361,7 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo
Audio::RewindableAudioStream *input = 0; Audio::RewindableAudioStream *input = 0;
if (Sword2Engine::isPsx()) if (Sword2Engine::isPsx())
input = Audio::makeXAStream(stream); input = Audio::makeXAStream(stream, 11025);
else else
input = Audio::makeWAVStream(stream, DisposeAfterUse::YES); input = Audio::makeWAVStream(stream, DisposeAfterUse::YES);