News for hackers. Stuff that matters.
Re:Digital Audio 101: Playing Audio from a Microcontroller by salehenrahman on Thursday April 15, 2021 @12:21PM (#26822481)
I could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz.

Obviously it's not going to be ideal for an audiophile, but the quality is not too shabby. A fun project for those curious.

Still, stick to off-the-shelf class-D amplifiers, such as the PAM8403.

https://www.youtube.com/watch?v=O8of40tFsD8

Re:Digital Audio 101: Playing Audio from a Microcontroller by squarefoot on Thursday April 15, 2021 @12:37PM (#26822757)
> I could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz.

Pretty sure you can do that. A Class D amplifier is to a class A/B traditional one what a switching power supply is to a linear one, so I would expect to be able to make a class D amplifier using for example a PWM driven H bridge usually employed to drive electric motors, or a chip used to make switching power supplies. If they can work at high frequencies (say 50KHz or more) then they should work; all it's needed is modulating their input or feedback pins the right way. Probably not HiFi for the sensitive ear, still good enough.

Re:Digital Audio 101: Playing Audio from a Microcontroller by Nihilartikel on Thursday April 15, 2021 @12:32PM (#26822670)
That would be really cool. Never got around to trying it, but I'm really curious about the subjective quality on the 12bit A/D conversion looping back to PWM D/A.

LoFi effects pedals could be fun.

Re:Digital Audio 101: Playing Audio from a Microcontroller by lb1lf on Thursday April 15, 2021 @01:18PM (#26823399)
-The 12 bit A/D provides a (theoretical) 72dB of S/N, so if you can do that at a decent sample rate to get sufficient bandwidth, the digitizing should be good.

As long as the PWM D/A has a good clock to keep the PWM ratio accurate, I think it should be eminently listenable, given a proper reconstruction filter and a decent power supply.

It would be fun to try this.

Re:Digital Audio 101: Playing Audio from a Microcontroller by GeorgeTirebiter on Thursday April 15, 2021 @08:14PM (#26827772)
Check this out -- really good discussion of bits and SNR: https://www.xiph.org/video/vid2.shtml jump to the 11:00 mark to find out just how many 'equivalent bits' those old cassette 'mix tapes' of yours had...