aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorjepael2016-09-07 23:22:18 +0300
committerjepael2016-09-07 23:22:18 +0300
commit5cc2696deb01041b71e3deaf9f6747f75470d24b (patch)
treee2adf76f40b9871942fb7e97e20dea90a42feab4 /audio
parent2e643276df90339f76a34897d4f9aeaf549ffb8d (diff)
downloadscummvm-rg350-5cc2696deb01041b71e3deaf9f6747f75470d24b.tar.gz
scummvm-rg350-5cc2696deb01041b71e3deaf9f6747f75470d24b.tar.bz2
scummvm-rg350-5cc2696deb01041b71e3deaf9f6747f75470d24b.zip
AUDIO: Fix CMS chips incorrect pitch.
The CMS emulation assumes the chips run at 8 MHz clock, but in PCs they run at 7.15909 MHz, so the emulated pitch is too high. Adjusting the requested sampling rate higher by matching amount the pitch is lowered down to normal.
Diffstat (limited to 'audio')
-rw-r--r--audio/softsynth/cms.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/softsynth/cms.h b/audio/softsynth/cms.h
index 8c0f980b0a..64df30e037 100644
--- a/audio/softsynth/cms.h
+++ b/audio/softsynth/cms.h
@@ -68,7 +68,9 @@ struct SAA1099 {
class CMSEmulator {
public:
CMSEmulator(uint32 sampleRate) {
- _sampleRate = sampleRate;
+ // In PCs the chips run at 7.15909 MHz instead of 8 MHz.
+ // Adjust sampling rate upwards to bring pitch down.
+ _sampleRate = (sampleRate * 352) / 315;
memset(_saa1099, 0, sizeof(SAA1099)*2);
}