Description
When using audioio
, I noticed that the DAC output makes a loud pop noise when it starts playing a raw sample or wave file. I suspect (but haven't verified) that it happens because the initial DAC value before playback is zero whereas the sample's zero voltage value correlates to the mid-value of the DAC. Playing the sample/file causes a large output voltage jump that, if the output pin is decoupled through a series capacitor, creates a noticeably loud pop.
Since audioio
is used for an AC audio stream with an zero baseline offset equal to 1/2 of the DAC's full scale, I'm wondering if it would be possible to slowly precondition the DAC output to the mid-point prior to playing a sample or wave file, then start playback with the next value in the stream that equals the mid-point value (within a reasonable threshold) -- in other words, manage the audio playback with reference to the sound's zero-crossing points.
This would primarily affect the start and stop of playback. Pause and resume should not be impacted since the DAC playback value should be frozen at a level close to the next value.