viert / go-lame

new generation lamemp3 bindings for Go
MIT License
42 stars 10 forks source link

Click sound at start of MP3 files #9

Open biblical-text opened 2 years ago

biblical-text commented 2 years ago

When reading a wav file (generated by github.com/go-audio/wav) there is an audible click at the start of the resulting mp3 file.

I wonder, is it treating the wav file header like audio data? I don't know enough about wav files and lame to have an intuition as to what is causing this.

Wameuh commented 2 years ago

Hi! I have the same issue. I have tried to discard bytes to be sure that lame does not consider them when reading the file... But my mp3 is not correctly encoded (the duration of the audio file is different between audacity, VLC or Groove Music).

For the moment I don't know how to proceed....

zaddok commented 2 years ago

Unfortunately the only way I have found around this issue is to do it the hard way. Write a temporary wav file to disk, and encode it by calling lame from go as a command line system command.

Wameuh commented 2 years ago

I have found a solution: using https://github.com/go-audio/wav to calculate the size of the header and discard those bytes in the bufio reader.

manazoid commented 2 months ago

I have found a solution: using https://github.com/go-audio/wav to calculate the size of the header and discard those bytes in the bufio reader.

Hey, can you share the code using this method? I very interested how you do it. Thank in advance!