TMRpcm icon indicating copy to clipboard operation
TMRpcm copied to clipboard

Qeustion - What is the output PWM frequency?

Open aerospacetgirl opened this issue 2 years ago • 1 comments

That's my question, what is the frequency PWM signal that this library used to play music. I don't own an oscilloscope and I couldn't figure it out from the code.

aerospacetgirl avatar May 31 '22 10:05 aerospacetgirl

It varies dependent on the format of the input audio. It should be roughly 2x audio sample rate, so for a 16khz sample, the PWM frequency is 32khz. Setting audio.quality(0); reduces it to 16khz for a 16khz sample. The oversampling gets rid of some of the noise from lower quality samples (around 8khz etc)

TMRh20 avatar May 31 '22 13:05 TMRh20