DracoNihil wrote:
Yeah to better rephrase my question. I'm wondering what the best implementation of "PCM through PC Speaker" exists, quality wise.
If you meant "by method", most programers had PWM figured out by 1987, so the obvious examples (ie. Space Racer, games with RealSound like Mean Streets, etc.) all use the same basic PWM method. PWM on the PC was best implemented using timer channels 0 and 2, with 0 (the system timer) firing an interrupt at the desired sample rate; each time it fired, you sent a PCM sample value to PIT 2 which was tied to the speaker output. When PIT 2 got the value, speaker immediately went high, then after the count expired, went low again. Because this is happening at the rate of PIT 0, the PIT 2 manipulation has the effect of manipulating the width of the pulses, hence Pulse Width Modulation (PWM).
The other method was to directly bit-bang the speaker, effectively treating it like a 1-bit PCM device, which earlier titles like Dunzhin used. That method produces very loud audio, but is quite distorted so it's only useful for speech.
I have been planning a PC speaker audio series for about two years but can never find the time to write the text. I've disassembled most significant games with PC speaker digitized audio, from Dunzhin in 1982 up to some titles from the 1990s, and part of the series was going to note which programs used which methods, and how the methods evolved over time. (This was spawned by curiosity into whether or not the RealSound patent should have been issued due to prior art. Long story short: No, it definitely shouldn't have.) I was also going to focus on related topics, such as audio compression methods that are simple enough they can be decompressed and output through the speaker in real time even on a 4.77MHz computer.
Sorry this series isn't done yet, or it would have answered your question...