Slashdot Mirror


JavaScript Decoder Plays MP3s Without Flash

An anonymous reader writes "The introduction of HTML5 and super-fast JavaScript engines to the latest web browsers has brought with it a wealth of new functionality. The focus seems to have been put on the ability to play video in a browser without Flash, or making games. But a project born out of a Music Hackday in Berlin is just as exciting. It's called jsmad and is a pure JavaScript decoder that allows you to play MP3s in a browser without Flash. So, for example, a music artist could create a website and upload songs for visitors to listen to without need of any plug-ins. Alternatively, why not have an MP3 jukebox that can play songs off your hard drive or Dropbox folder just by loading a website? You can try out the decoder by visiting the jsmad.org website where there is a sample song, on the same site you can browse for your own local file to play. Be warned, it only works in Firefox 4+ at the moment, but Chrome support is coming and already works in some cases." Another reader tips news of a JavaScript PDF viewer.

9 of 250 comments (clear)

  1. mp3? Acrobat! by Joce640k · · Score: 4, Insightful

    I'd say that getting rid of the Acrobat plugin is far more interesting.

    --
    No sig today...
    1. Re:mp3? Acrobat! by ByOhTek · · Score: 3, Interesting

      I use foxit. There's also Okular. I probably shouldn't forget [g|k|x]pdf... Plenty of alternatives to acrobat.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  2. It's coming by TRRosen · · Score: 3, Funny

    I'm writing a browser in JavaScript that will run on itself !!!

  3. Re:Err by Dishwasha · · Score: 3, Insightful

    Not having to have a native mp3 decoder codec on your machine. Also being javascript it is theoretically compatible across all platforms that the browser supports, particular those that may not have native mp3 decoder codecs. The HTML5 standard isn't attempting to establish a standard for codecs. Not saying it's worthwhile or anything, just pointing out potential benefits as you requested.

  4. Re:The rise of Javascript. by TerranFury · · Score: 3, Insightful

    your options pretty much break down into "javascript" or "assorted architecturally superior; but single-platform and/or deeply fucked in the code quality plugins".

    You'd think Java would be filling this role, but it isn't.

  5. Re:Can't HTML5-compatible browsers play MP3s nativ by Anonymous Coward · · Score: 5, Insightful

    And once agan, just like with H.264, they wouldn't have to pay any license fees if they just used the OS's own media API instead of trying to support specific codecs themselves.

    Modern OSs provide such an API for playing audio and video, and some (ie. Mac OS and Windows) even provide licensed proprietary codecs... not to mention that OS-provided codecs often work with things like video drivers to provide hardware acceleration that is transparent to applications. For example, VLC, while awesome, uses a huge amount of my CPU to play 1080p H.264 video, since it's software decoding (possibly with some generic "hardware assist"). On the other hand, Windows Media Player, which uses Microsoft's DirectShow codec which takes advantage of my GeForce card's full H.264 decoding, uses 1% of my CPU to play the same video.

    Browsers already make use of other OS-specific features, and this would make the whole codec licensing thing a non-issue for the browser makers, and for the vast majority of users. They need to stop trying to reinvent the wheel. The OS provides services to applications... browsers should use them.

  6. Re:Err by BZ · · Score: 3, Informative

    Gecko does not support MP3 in HTML for exactly the same reason it doesn't support H.264 in : it's patent-encumbered and you have to pay licensing fees to use it.

    In 6 years, when the MP3 patents expire, we'll see.

  7. bettter than I tought by JonySuede · · Score: 3, Interesting

    I was worried about the cpu consumption of this and it only took between 7 and 13 % of one q6600 core on firefox 7.0a1 nightly

    --
    Jehovah be praised, Oracle was not selected
  8. Re:The rise of Javascript. by Timmmm · · Score: 4, Informative

    No, there are many things wrong with Javascript. Just a sample:

    1. The == operator. What. The. Hell. (Yes I know about ===; that's beside the point).
    2. No true arrays. They are actually maps/associative arrays. (And that's the only thing you get.)
    3. No typing. E.g. you can't have a 16 bit int, or an array of bytes.
    4. No real integers. Bitwise operations are done by converting from doubles to int, and then back again.
    5. Way too much implicit conversion (the stupid '1'+'1' -> '11', but '1'-'1' -> 0 thing).
    6. No data hiding of any kind. Everything is public (unless you use crazy hacks). You can't even be sure third party code hasn't modified your classes.
    7. Implicit semicolon. It's just a bad error-prone idea. (And I have *no* idea why Go made the same mistake.)
    8. No support for proper modules. You basically have to put everything in one file, which wouldn't be so bad if the IDEs didn't all suck.
    9. It's basically impossible to reason about performance, partly because of the new-fangled tracing/JIT engines, and partly because the spec doesn' make any
    guarantees about complexity.

    I'm not saying it doesn't have nice features, it just has a lot of ugly "let's make this easy for noobs" mis-features that actually fuck everything up, which is a shame.