The Pico has no DAC. So you can't play audio - or can you?

Here's a test of how GlyphBlaster will play audio. It's pretty much identical to the way PWM audio is played on the PC - bit-banging the speaker on and off rapidly.

This is the music from Area 5150's credits scene, by cTrix.

#glyphblaster

Turns out there's an even more efficient way to simulate a DAC - set a PWM pin to a high multiple of your sample rate, then use your sample data to modulate the PWM duty cycle. This method was demonstrated by antirez.
@gloriouscow That's an accepted way to make a DAC. Put a low pass filter with the right parameters between the PWM and the speaker and you get a perfect reproduction of the original sample, Nyquist limit and resolution permitting. Just like with a PCM DAC.
@gloriouscow oh... I think I see what you mean... it's a simulation in the sense that the PC speaker hardware isn't intended to be used as a DAC. (But I would argue that it IS a DAC when set up in this way, albeit a crappy one 🙂).

@whimsy I called it a simulation of a DAC because real DAC hardware would just take your samples without fuss and do it for you.

is it electrically equivalent? maybe, but it looks like an odd duck from a software perspective.

@gloriouscow I never thought of the process of reading from a buffer as being part of the DAC but that might be an oddity on my part and I'm splitting hairs at this point 🙂
@whimsy i have no real electronics background so half the shit i say when i talk about this stuff probably sounds stupid

@whimsy nobody would call the abomination you create by driving samples into the reload register of the 8253 to drive a PC speaker with PWM a DAC.

yet that's not too far removed from what we're doing here

@gloriouscow I don't suppose they would, no, but it is electrically equivalent to a really bad PWM DAC with no filter (at least per my understanding).