guo-yu / player

a command line player, supports play mp3 both from uri and local stream.
261 stars 66 forks source link

No support for Content-Type: audio/mp3 #52

Open gbxl opened 8 years ago

gbxl commented 8 years ago

You say it plays mp3, but it seems like it is very limited, down to only 'audio/mpeg' (https://github.com/guo-yu/player/blob/master/dist/player.js#L341). I tried replacing it by "audio/mp3" and it seems to be working. You should have an array of available content types. I think 'audio/mpeg' only is too restrictive.

guo-yu commented 8 years ago

Will add a list to check out if the coming stream is a acceptable mp3 stream, thank you

gbxl commented 8 years ago

I'm actually having all kind of issues with the "audio/mp3" files like:

Note: Illegal Audio-MPEG-Header 0x41504554 at offset 11011098. Note: Trying to resync... Note: Hit end of (available) data during resync. [../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)

It seems to be related to lame, but I'm not sure.

ewnd9 commented 8 years ago

@gbxl 'audio/mpeg' is default mime type for mp3 files. Try to serve mp3 files with python -m SimpleHTTPServer, they would have 'audio/mpeg' header and will be playing fine by player

gbxl commented 8 years ago

My files are hosted on S3. But switching to 'audio/mp3' in player's code allows me to play the files. I just get errors. That seems crazy to me that those errors would be only due to http headers. I believe there is another issue.

ewnd9 commented 8 years ago

@gbxl if server uses non-standard mime type, it can also somehow modify content. Also are you sure you have errors? Log from previous message contains only warnings.

gbxl commented 8 years ago

Yeah, I usually get a [1] 42226 segmentation fault node test.js after a couple of those warnings.