go-audio / wav

Battle tested Wav decoder/encoder
Apache License 2.0
300 stars 46 forks source link

making PCM data seekable #6

Closed glaslos closed 6 years ago

glaslos commented 6 years ago

I had the use case where I was decoding an audio file and encoding various parts of it into a new audio file. The most elegant solution was by exposing the Seek method on the PCM buffer.

glaslos commented 6 years ago

@mattetti any chance to get some feedback on this PR?

mattetti commented 6 years ago

Apologies, I missed the PR for some reason. Looking at it now

mattetti commented 6 years ago

It looks good but to be clear, you aren't Seeking the PCM data but the underlying reader. What I mean by that is that going back to origin (0,0) won't take you to the start of the PCM data but to the start of the fime. You obviously know that but I felt it would be good to document on this ticket incase someone find by looking for seeking the actual PCM data.

glaslos commented 6 years ago

Yes, bad wording from my side :) I actually used it to rewrite the header.