[Scummvm-git-logs] scummvm master -> ca2f2071c2e23c2f6847a83e71be1050762cf35e
mgerhardy
noreply at scummvm.org
Wed Feb 12 10:53:44 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ca2f2071c2 TWINE: fixed pitch handling for samples
Commit: ca2f2071c2e23c2f6847a83e71be1050762cf35e
https://github.com/scummvm/scummvm/commit/ca2f2071c2e23c2f6847a83e71be1050762cf35e
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2025-02-12T11:52:31+01:00
Commit Message:
TWINE: fixed pitch handling for samples
see https://bugs.scummvm.org/ticket/15735
Changed paths:
engines/twine/audio/sound.cpp
diff --git a/engines/twine/audio/sound.cpp b/engines/twine/audio/sound.cpp
index 19a72209cfb..6dcf4d2e8a6 100644
--- a/engines/twine/audio/sound.cpp
+++ b/engines/twine/audio/sound.cpp
@@ -131,14 +131,13 @@ void Sound::playSample(int32 index, uint16 pitchbend, int32 repeat, int32 x, int
samplesPlayingActors[channelIdx] = -1;
}
- // TODO: implement pitchbend - see https://bugs.scummvm.org/ticket/15735
- // frequency would be 11025 + (pitchbend - 0x1000);
-
uint8 *sampPtr = _engine->_resources->_samplesTable[index];
uint32 sampSize = _engine->_resources->_samplesSizeTable[index];
Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, DisposeAfterUse::NO);
- Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES);
+ Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
playSample(channelIdx, index, audioStream, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kSFXSoundType);
+ uint16 frequency = 11025 + (pitchbend - 0x1000);
+ _engine->_system->getMixer()->setChannelRate(samplesPlaying[channelIdx], frequency);
}
bool Sound::playVoxSample(const TextEntry *text) {
More information about the Scummvm-git-logs
mailing list