mamedev / mame

MAME
https://www.mamedev.org/
Other
7.76k stars 1.96k forks source link

ST0016 sound device sports incorrect voice sample pitches #7301

Open tpunix opened 3 years ago

tpunix commented 3 years ago

The sound of srmp5 is incorrectly.(the sega saturn version: https://www.youtube.com/watch?v=-zHemD6UrUM&t=120s) I dump the sound data from st0016, and play it with aplay: aplay -t raw -r 8192 -f S16_LE raw_dump.bin The voice sounds correct. The sound data should be 16bits, but st0016 driver read as 8bits. 4_0005b3a0_0006a64d_4ae9.zip

tpunix commented 3 years ago

I made a mistake... The captured data can also be play with S8 and samplerate 16384.

tpunix commented 3 years ago

The raw data (S8 and 16384), using a scale factor 0x4ae9/0x10000, result output stream at rate 55991. But St0016 using samplerate at 44100. This is why the voice is bad.

angelosa commented 3 years ago

st0016 sound emulation looks very preliminary and not sure why it's not marked with imperfect_sound flag. Having said this, at least also yuka (in macs.cpp) sports the same issue as well with voice pitches, updated issue title to reflect this, there are chances that samples uses a different sound mode altogether,

angelosa commented 3 years ago

MT#07879 is another offender of this.