faiface / beep

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

Some mp3 return SampleRate of 0 when decoding #15

Closed zapic0 closed 5 years ago

zapic0 commented 6 years ago

I'm having an issue with some mp3, these files are decoded, no error is returned but format SampleRate has 0 value.

You can try to reproduce playing any mp3 from google text to speech, for instance: http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=testing%20for%20beep&tl=en

Edwin-Luijten commented 6 years ago

I am having the same issue, I attached the file I test with. audio_file.zip

I create attached file by base64 decode the response and store it as an .mp3 file. When printing the sample rate, it show: 0.

Update, when I save the file as Wav file, it works.

faiface commented 6 years ago

This will probably be a problem with https://github.com/hajimehoshi/go-mp3, which is used by beep/mp3. @hajimehoshi

hajimehoshi commented 6 years ago

Huh, sorry but I'm quite busy to investigate those problems.

@faiface If you want to fix the problems asap, I'd recommend to consider to switch MP3 decoder to https://github.com/lieff/minimp3, which is well tested but not pure Go.