Seeking will now seek to the exact position specified instead of the start of the frame. The mewkiz/flac can only seek to full frames because it only returns full frames.
Decoding now fills samples directly from frame without a buffer in between.
Seek didn't clear the internal buffer, the point above resolves this problem as well.
Removed unnecessary casting, which collapsed the big switch case into a simple if statement.
Replaced the FLAC file in the internal/testdata directory because it didn't actually seem to match the samples of the WAV file. Maybe Audacity does post-processing to it. I converted the WAV to FLAC using ffmpeg this time, which results in exact-match samples.
flac.Seek()
seems to be buggy. Let's fix it :)mewkiz/flac
can only seek to full frames because it only returns full frames.samples
directly fromframe
without a buffer in between.internal/testdata
directory because it didn't actually seem to match the samples of the WAV file. Maybe Audacity does post-processing to it. I converted the WAV to FLAC using ffmpeg this time, which results in exact-match samples.