I’m trying to decode SNES BRR.

The waveform above in the figure is the output of the library I’m referring to. The below is the output of mine.
Mine sounds like what it sounds, but I hear a lot of noises. The figure shows the difference clearly. The next step is to figure out where the noises come from.