mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-07 10:48:43 +00:00
ULTIMA8: Adjust audio channel rate using pitch shift variable
This commit is contained in:
parent
d89c9e1523
commit
f7d13fdd35
@ -21,6 +21,7 @@
|
||||
|
||||
#include "ultima/ultima8/misc/common_types.h"
|
||||
#include "ultima/ultima8/audio/audio_channel.h"
|
||||
#include "ultima/ultima8/audio/audio_process.h"
|
||||
#include "ultima/ultima8/audio/audio_sample.h"
|
||||
#include "common/memstream.h"
|
||||
#include "audio/audiostream.h"
|
||||
@ -92,7 +93,10 @@ void AudioChannel::playSample(AudioSample *sample, int loop, int priority, bool
|
||||
// Play it
|
||||
int vol = (_lVol + _rVol) / 2; // range is 0 ~ 255
|
||||
int balance = (_rVol - _lVol) / 2; // range is -127 ~ +127
|
||||
|
||||
_mixer->playStream(isSpeech ? Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType, &_soundHandle, stream, -1, vol, balance);
|
||||
if (_pitchShift != AudioProcess::PITCH_SHIFT_NONE)
|
||||
_mixer->setChannelRate(_soundHandle, stream->getRate() * pitchShift / AudioProcess::PITCH_SHIFT_NONE);
|
||||
if (paused)
|
||||
_mixer->pauseHandle(_soundHandle, true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user