I saw another audio project on the same microcontroller (family) posted a few days ago: ModPlayRISCV It plays a tracker MOD. using PWM with a low-pass filter. It resamples/scales all samples at varying rate/volume into a ring buffer which gets fed to the PWM comparator by DMA.

https://github.com/cpldcpu/ModPlayRISCV