hajimehoshi / go-mp3

An MP3 decoder in pure Go
Apache License 2.0
746 stars 80 forks source link

MPEG2 support #12

Closed wasedaigo closed 4 years ago

wasedaigo commented 7 years ago

It seems ebiten cannot play certain mp3 files in mpeg format other than 1.

mp3: only MPEG version 1 (want 3; got 2) is supported

This means, we cannot always expect MP3 we download from the internet to work all the time, this is pretty inconvenient. Currently I am looking for a way to convert MPEG version on my own, but it would be nice if go-mp3 can support multiple versions.

hajimehoshi commented 7 years ago

First I need to buy and read the MP3 specification :-)

K4thos commented 6 years ago

got the same problem. Not sure how to understand the reply. Are there plans to implement support for MPEG2?

hajimehoshi commented 6 years ago

Not so far since I'm quite busy, but do you really need to play MPEG2 mp3 files like 22050 hz?

K4thos commented 6 years ago

hajimehoshi, thanks for reply. The file I tested was converted by me in audacity with default settings. I need mp3 support for an open engine that allows players to use whatever supported resources they like. I'd prefer to avoid having to read bug reports saying that this and that particular mp3 file crashes the program. I'm not expecting the typical player to know the difference between MPEG1 and MPEG2 (hell, up till now even I didn’t know that this matters). No idea in which format most of the available music is in, but if MPEG2 has some adoption than I think it’s worth to implement at some point.

hajimehoshi commented 6 years ago

The biggest difference between MPEG1 and MPEG2 (and 2.5) is the supported sample rate: MPEG1: 32k - 48k [Hz] MPEG2: 16k - 24k [Hz] MPEG2.5: 8k - 12k [Hz] See also: https://en.wikipedia.org/wiki/MP3#Bit_rate

I understand there are some demands to support MPEG2 and even 2.5, but the priority is still low to me. I think 44100 [Hz] or 48000 [Hz] is the most typical sample rate, and the other sample rate is not so major.

laice commented 5 years ago

Get this error with MP3s returned from the Google Text to Speech API. +1

papr8ka commented 5 years ago

Get this error with MP3s returned from the Google Text to Speech API. +1

Would be wonderful to add for this purpose.

tyrm commented 5 years ago

Same issue with files from Amazon Polly :( +1

mateusmaaia commented 5 years ago

I am having the same issue when using Google Text to Speech API. +1

samm02 commented 5 years ago

Am having this issue with Amazon Polly also :( +1

silverkt commented 5 years ago

+1

kvark128 commented 5 years ago

+1

sunbin728 commented 4 years ago

+1

berkant commented 4 years ago

+1. I had to switch to Vorbis (.ogg) because TTS-generated MP3 files are not working.

hajimehoshi commented 4 years ago

I don't have bandwidth now. I'm happy if someone could create PRs.