I recently got my hands on a Photon 2 and was hoping to play some audio with it. With the first generation Photon, I was able to use the speaker library, which uses the Photon's DAC with DMA defined by the STM32 library under the hood.
The Photon 2 is based on a RTL8721DM chip however, and not only that but I realized it doesn't come with an onboard DAC (the migration guide suggests hooking up an external one).
So the first thing I tried was to use PWM and play some 8 bit audio with analogWrite(), by exporting signed 8 bit PCM from Audacity and modifying the tool here to output an 8 bit array. However, it sounds terrible and the sound is nearly unrecognizable. While I could try to put some low-pass filter on the end, it seems like the best thing is to get some true analog output with a DAC. Or I could fall back to much simpler Atari-style tones but where's the fun in that? ![]()
Anyone have recommendations for a DAC that would work, and also any library like speaker that would work for playing audio?