Live data from Hacker News

JavaScript mp3 decoder allows Firefox to play mp3 without flash

jsmad.org

91–99 of 99 posts

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#92

Technical question: You're using goto in a do/while loop here : https://github.com/nddrylliog/jsmad/blob/master/src/decoder.... How are you pulling this off? I ask because while goto is a reserved word in JavaScript I didn't think it did anything.

Good question :) If you watch the resources/network tab under Chrome/Firebug you'll notice that decoder.js isn't used in the demo. It's my unfinished attempt to port libmad's decoder.c, so it still contains a bit of C code, I'm not even sure it's valid Javascript at this point :)

In the demo, we're replicating some of its functionality in https://github.com/nddrylliog/jsmad/blob/master/src/player.j... instead, although in a less robust way.

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#93
post #88

jsmad lead developer here, shoot if you have any questions!

I think this is the beginning of something beautiful. On Chrome 13 if you enter a new ID track and hit enter it will keep playing the old song even if you start playing the new one or it will have that crkkkk repeating sound. :) Firefox 4 seems to have no problem but you have to sometimes hit refresh and then play to get the new track playing. One cool feature would be to make a random ID track generator so you won't…

Thanks for the feedback, jaquis!

Re: Chrome 13, I haven't had a chance to test this myself, but I suspect that dev.kill() doesn't work as expected then :/ if it's a Chrome bug that would really suck cause it wouldn't be the first one.. see http://code.google.com/p/chromium/issues/detail?id=82795 (seriously Google Chrome team, get your stuff straight!)

Re cool feature: actually, we had in mind using the Official.fm Simple API (see http://official.fm/developers/simple/ for more infos) to add a Search feature. As an official.fm dev, though I'm warning you: our search system is undergoing serious refactoring and the current system has lots of... room for improvement, put politely.

Thanks again for your time!

While I'm at it, I forgot to say this, but: if you have MP3s that don't play, please upload them on Mediafire and submit a Github bug report: https://github.com/nddrylliog/jsmad/issues - you'd be surprised how quick we can figure out, after collectively spending 300+ hours debugging the code :)

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#94

Earlier quoted context omitted.

From what I hear,the HTML5 tag implementation quality varies wildly. It hasn't been used much in production for desktop-targeted web apps. It is, however, quite popular on the iPlatforms, because you have no Flash there! As far as I can tell, jsmad is not going to replace the HTML5 audio tag on mobile devices. However, it does constitute a nice legal workaround for MP3 in desktop browsers such as Firefox. It gives ac…

One of the main problems with the html5 audio tag isn't that it doesn't play audio, it is that it doesn't allow the control needed for things like gaming (playing different streams in different speakers, no latency guarantees, etc).

This is exactly where jsmad could shine, even on current browsers (on FF4/Chrome10+). Game usually use small sound effects, that can be decoded in a few ms and then stored in buffers. From there, it'd be very easy to do the mixing in pure JS using audiolib.js - which is a treat, btw! You'd get as many audio channels as your CPU can handle, mixed in realtime. If the Audio Data API / Web Audio API support more than 2 channels, we might even be looking at full 5.1 demos real soon.

This is so exciting!

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#95
post #40

Earlier quoted context omitted.

Yes, it is stuttering right now. Especially when it is in the background. We think this is a buffering issue, but yes. We hope this will be able to go into production soon(tm).

FWIW, I'd love to see support for icecast or shoutcast streams.

As long as they contain only MP3 files, that would be really really easy to do. If someone does it on Github, please ping me - we'd love to host it on jsmad.org

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#96

First HTML5, now JS? Looks like everyone's trying to make Adobe obsolete.

And I'm sure hoping we succeed! They recently pulled the plug on Adobe Air Linux support ( http://blogs.adobe.com/open/2011/06/focusing-on-the-next-lin... ), which only makes them look worse in the eyes of devs like me.

I don't care if the year of the Linux desktop never comes - you just don't pull the plug one something like that. Adobe is becoming incredibly irrelevant to the consumer, while still strong to the content producer market - which I want to know nothing about anyway. So, all the best :)

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#97
post #86

Not sure if anyone has mentioned this yet, but I'm noticing speed/pitch differences in playback when I load a file from my disk versus playing in iTunes. Billy Joel sounds more like Janis Joplin. Edit: Horrible bug report -- I'm in Chrome 12 with the Web Audio about:flag enabled on Mac OS X 1.6.7 Edit 2: Just tested in Chrome Dev 14 and the issue is unchanged.

Haven't noticed this myself. Can you upload an example mp3 file and file a Github bug? https://github.com/nddrylliog/jsmad/issues (Also, I don't have a 'Web Audio' flag in my Chrome 12 - I have in Chrome Canary on Windows though).

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#98

If imitation is the sincerest form of flattery, feature requests must be the next-sincerest. With that out of the way, I'd love to see: * Standard playback widgets: volume, position slider, etc. * A way to link songs, e.g. http://jsmad.org/play/114578 Fantastic work!

Here's a nice dubstep/electro playlist to thank you guys for all the jsmad testing:

http://jsmad.org/play/176848 | N.E.R.D & Daft Punk - Hypnotize U (Nero Remix)

http://jsmad.org/play/266408 | Nero - Me & You

http://jsmad.org/play/201732 | Cassius - I http://jsmad.org/play/265379 | The Streets - Blinded By The Lights (Nero Remix)

http://jsmad.org/play/237774 | Ellie Goulding - Lights (Bassnectar Remix)

There's some awesome music on Official.fm :) I'm so thankful I get paid to develop stuff like jsmad over there.

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#99

Earlier quoted context omitted.

One of the main problems with the html5 audio tag isn't that it doesn't play audio, it is that it doesn't allow the control needed for things like gaming (playing different streams in different speakers, no latency guarantees, etc).

This is exactly where jsmad could shine, even on current browsers (on FF4/Chrome10+). Game usually use small sound effects, that can be decoded in a few ms and then stored in buffers. From there, it'd be very easy to do the mixing in pure JS using audiolib.js - which is a treat, btw! You'd get as many audio channels as your CPU can handle, mixed in realtime. If the Audio Data API / Web Audio API support more than 2 c…

I agree! And actually you can already do multichannel stuff, but currently that requires you to use either Audio API exclusively, because Chrome supports only 2 channels for javascript processing (but the internal effects are multi-channel), but Firefox supports only javascript processing.
Post reply on HN