Slashdot Mirror


Breakthroughs In HTML Audio Via Manipulation With JavaScript

jamienk writes "Imagine if you could grab and manipulate audio with JavaScript just like you can images with Canvas. Firefox experimental builds let you do just that: crazy audio visualizations, a graphic equalizer, even text-to-speech, all in JavaScript! Work in progress; you need a special build of Firefox (videos available), being worked on via W3C."

18 of 141 comments (clear)

  1. Dear Internet: Sorry. by B5_geek · · Score: 3, Funny

    All I can think of is <BLINK> </BLINK> turned into audio!

    Of course this has good uses (blind users with scripts available), but I can see how this will end badly for the rest of us.

    --
    "The price good men pay for indifference to public affairs is to be ruled by evil men." ~Plato (427-347 BC)
  2. Re:I'm all for this by Yvan256 · · Score: 2, Insightful

    FYI, Quicktime is not awful at all on Mac OS X, nor is Safari and iTunes. And almost everything from Microsoft and Adobe sucks on Mac OS X.

    I don't know why you associate Quicktime with online audio, so what you probably meant to say was "The quicker we can get away from our reliance on that god awful Flash, the better."

    Be prepared for another "Firefox vs the World" with this, however: Vorbis vs MP3/AAC.

  3. Screen readers... by dclozier · · Score: 2, Insightful

    This will be fantastic for aiding those that have vision impairments. The 503 compliance will end up including this if it is ever standardized. (w3c not known for speed)

  4. Re:Dear Internet: Sorry. by Yvan256 · · Score: 5, Funny

    You mean annoying like people who put their comments between <code> tags?

  5. Re:Pac-Man by scurker · · Score: 2, Informative

    The game and all the movements were Javascript. The sounds were done with flash.

  6. Re:I'm all for this by 42forty-two42 · · Score: 2, Informative

    Be prepared for another "Firefox vs the World" with this, however: Vorbis vs MP3/AAC.

    Not really. Vorbis has about the same quality per bit as AAC (unlike theora vs h264), and it's established long enough to not have patent issues. There's no reason not to implement support for Vorbis, and it's plenty good enough to be the default codec. What's more, Youtube's behind Vorbis (it's part of the WebM spec), and since Flash has pledged support for WebM, they'll have it too.

  7. Re:Dear Internet: Sorry. by Darkness404 · · Score: 4, Insightful

    You mean that you expect this to actually be used?

    IE doesn't even have support for canvas, Firefox has had it from 3.0 at least, and I think even 2.0 had some support.

    If IE still has more than 30% worldwide marketshare, and doesn't have basic requirements for this, its not going to be used. Period.

    Canvas has been around for ages and is there even a single practical example on a site people use daily? Yeah, there are about a million tech demos but very little actual use because IE doesn't support it.

    --
    Taxation is legalized theft, no more, no less.
  8. Re:Dear Internet: Sorry. by K.+S.+Kyosuke · · Score: 5, Funny

    Well, he's a disciplined programmer, he puts comments in his code.

    --
    Ezekiel 23:20
  9. Flash Helper; State of JS Audio by weston · · Score: 2, Interesting

    From what I've read, there was an off-screen flash helper playing the audio, and I'm not surprised. It's nigh impossible to get reliable audio with JavaScript only. People have been doing some experiments with stuffing data urls into , , and tags for a while now (heck, I've been doing it since last fall) in order to programmatically generate audio, but it generally suffers from performance issues and various glitches for a while now. You can mostly pull it off only if you stick with MIDI or you use Flash or Java to deliver the audio.

    Here's something I didn't get until recently: Audio is in some ways harder than video. It's more timing sensitive. With video, you're generally slinging a lot more data per frame, but you can get away with *much* lower frame rates... 24 fps works, 60's not bad, and you don't have to get much higher than that to pass the threshold of perception. With audio, very small "frames"/samples will hold adequately resolved data from one point in the signal, but you have to move a lot *more* of them (44,100 of 'em per second for CD quality audio) and move them *reliably* in order to get sound fidelity. JavaScript timing might be millisecond reliable except in IE, but it's not microsecond reliable. Totally realtime programmatic sound is probably out of the question for a while.

    But, programmatic generation of the audio *data* is possible now, and you can probably precompute enough things ahead of time that if they can work the bugs out of the audio tag or something else to enable microsecond level starting/stoping/looping of playback, then pure JavaScript audio would get real wings.

    1. Re:Flash Helper; State of JS Audio by roca · · Score: 2, Informative

      There is no Flash involved here, you read wrong. I wonder why you got modded up.

  10. Re:I'm all for this by 42forty-two42 · · Score: 2, Informative

    Vorbis has been used by a number of major game publishers for game audio, precisely because it has no license fees. I think WoW would be a big enough target for the patent trolls, how about you?

  11. Re:Firefox, eh? by Compenguin · · Score: 2, Informative

    > However, mp3 is not free...yet. Some of these patents are set to expire on their 20 year time frame in a couple of years it would seem.

    Yes, the next MP3 patent expires this Sunday. The longest patent seems to expire in 2018 but that appears to be MPEG-2 LSF and only required for low sample rate MP3s. So the next furthest date looks like April 2017 but it may be worth double checking the dates on those around 2014/2015.

    http://wiki.multimedia.cx/index.php?title=MP3_Patents

  12. Re:I'm all for this by KuNgFo0 · · Score: 2, Informative

    Example case - trailers from trailers.apple.com - the ones hosted at apple typically demand that you have Quicktime installed (obviously since Quicktime is their technology). Quicktime might be dandy on the Mac but is most definitely god awful on the PC - much worse than Flash, in fact I'd put it in the same category as Adobe Reader or Real Player plugins.

    Further more, Quicktime's browser plugin assigns itself as the default player for many types of media - including mp3 files. So every time I click on an .mp3 link in Firefox, the Quicktime plugin fires up and starts playing it - and its player sucks. Also, since it's impossible to install iTunes without Quicktime, every time I install or upgrade iTunes I have to go through and decrap-ify all the mime associations for Quicktime.

    Yes I will be happy when Quicktime dies.

  13. Re:Firefox, eh? by marcansoft · · Score: 4, Informative

    Third, unlike Theora and H.264, Vorbis is actually much better than MP3.

  14. wisdom by The+Clockwork+Troll · · Score: 2, Insightful

    It was Chris Rock, who said, "You can do it, but that don't mean it's to be done."

    --

    There are no karma whores, only moderation johns
  15. Re:I'm all for this by BenoitRen · · Score: 2, Informative

    If you look at the w3schools.com listings

    For fuck's sake, when will people understand that the listings on w3schools.com ARE ONLY FOR THAT SITE AND NOT REPRESENTATIVE OF THE GLOBAL MARKET SHARE?!

  16. Re:Vorbis vs MP3 by Randle_Revar · · Score: 4, Informative

    Vorbis has smaller file sizes for the same quality or better quality for the same file size (q1 (~80kbps) is easily comparable to 128kbps MP3).
    Vorbis also supports up to 255 channels with official channel ordering specs up to 8 channels (7.1), while MP3 only supports mono and stereo.

  17. Re:I'm all for this by sabernet · · Score: 2, Interesting

    Apple picked PNG because Microsoft didn't. And screencap image formats were hardly going to be an industry deal breaker. BMP files are so obvious as to really not give any leverage to Microsoft. Any patent on the silly thing would be overturned("Method for displaying a picture by lining up the colored pixels in order?").

    Apple is pro-open-formats only if there's no way to get a lock-in. Apple is a patent holder with MPEG-LA, hence their preference for H.264.

    Remember that there's nothing preventing you from installing Theora and Matroska codecs on your Windows box, same as with your Mac. Sure, media player will push you towards wma, but Apple will push you towards Apple Lossless.

    "Microsoft has a history of always creating their own formats even when a multitude of alternatives already exist"

    - iPad USB dongle
    - iPhone/Pod connector
    - Their old practice(no longer the case) of locking their RAM so only their RAM would work on their hardware
    - The stupid one button mouse(yes, it's no longer the case, but it was).

    Not saying MS is good. They're not. But neither of them are. Trying to say "At least Apple..." these days is a tricky game.

    Also, MS has stated that IE8+ will handle WebM just fine as it can be installed via Media Player. Opera stated support. Mozilla breathed a sigh of relief and quickly said the same. Apple(or at least Turtleneck Prime) is the only one that seemingly indicated they wouldn't support it by throwing some lawsuit FUD around. They may yet, but the response wasn't exactly positive.