The latter part sounds like PC speaker but the first part doesn’t. How does the first part work? Pulse width modulation to play samples or something like that?
Yes PWM is used to play amiga-like quality pcm samples. The ZX Spectrum beeper cannot play amiga-like pcm samples because the Z80 cpu is not as powerful as the Intel 8088 (And also the fact that the ibm pc had what is called the Intel 8253 PIT which is a dedicated chip for the IBM PC Speaker also helps. And also the intel 8253 PIT has a “programmable one-shot” mode which is what the game Skweek is using)
Here is an alternative Piped link(s):
https://piped.video/watch?v=ixVnLbrU4ME
Piped is a privacy-respecting open-source alternative frontend to YouTube.
I’m open-source; check me out at GitHub.