Whileas I can set this up (see subject) for an Arduino Uno (PWM-Out on D11 with 62.5kHz, Timer1 for the sample-output with 12.5 kHz (*)) I seemingly cannot for the Leonardo. I suppose that this is not such an uncommon setup so I did a search for a working example on IRQ-driven audio-out on the Leonardo, so I can see where my errors/misassumptions are… but… well… I didn’t find anything… hmm,… Maybe someone here has used the Leonardo for a similar setup and can help me out?
(*) My experiments with the Uno clearly show, that for clear pcm-pwm-audio you will need to stay in sync with the PWM-rate. So you MUST use fSR = (fPWM/n) with n=[1,2,3,4…] as otherwise you will have really bad aliasing in the output… Using phase-correct PWM or not does not matter at all. The later is an urban-myth…