gopxl / beep

A little package that brings sound to any Go application. Suitable for playback and audio-processing.
MIT License
295 stars 15 forks source link

Fix WAV pop sound after seek with unknown chunk in header #183

Closed MarkKremer closed 2 months ago

MarkKremer commented 2 months ago

Resolves #182

The pop sound was caused by an error in the header size calculation. When a WAV file contained a unknown chunk, first the chunk type (4 bytes) is red, then the size (4 bytes) and after that is the chunk data. The 4 bytes indicating the size weren't added to the total header size. When seeking to the beginning of the sample data, it would seek to a position in the header before the data. The header was then parsed as sample data, which caused the pop.

Test file: pop.zip Can be reproduced with the speedy-player by changing the decoded file type to WAV.