5 ms·
The sounds are included directly in the JS, which is pretty neat: https://github.com/theonion/fartscroll.js/blob/master/fartscroll.js https://github.com/theonio
by noelwelsh 14y ago
The sounds are included directly in the JS, which is pretty neat: https://github.com/theonion/fartscroll.js/blob/master/fartscroll.js https://github.com/theonion/fartscroll.js/blob/master/fartsc...
- morsch 14y agoAnd in ogg as well as mp3, to boot. Settling once and for all the great question which of these two codecs is more efficient at encoding flatulence.
- bornhuetter 14y agoWell - which is more efficient?
- rubinelli 14y agoWhat's important is that neither stinks.
- campnic 14y agoI would say that including two audio assets for the same sound seems like a code smell.
- IgorPartola 14y agoPerhaps an MP3 => OGG JavaScript converter is in order.
- alanh 14y agoTranscoding is not a computationally cheap endeavor…
- IgorPartola 14y agoWell, since we are talking about a demo/proof of concept it could be interesting to try.
- libria 14y agoIn case it slipped right past your nose, the previous comments were a play-on-words in reference to the library.
- IgorPartola 14y agoIt didn't, but I was wondering about the actual technical aspect of using a single asset type and a codec as a shiv.
- svachalek 14y agoI think he meant to say an MP3 => OGG JavaScript converter is an odor.
- akerbeltz 14y agoAt least in terms of size, the mp3 strings are 23%~ lighter than the ogg strings.
- jlogsdon 14y agoCurious what quality they encoded them with.
- jack-r-abbit 14y agoIt is a fart sound... how much quality do they need? lol
- stevenspasbo 14y ago320 kpbs
- akerbeltz 14y agoThe ogg's bitrate is 35kb/s. The mp3's bitrate is 32kb/s. The sample rate for both is 11025 Hz.
- xhroot 14y agoIt's because Firefox doesn't support mp3 via the HTML5 <audio> tag due to licensing IIRC. IE supports mp3 but not ogg. Chrome supports both.
- tommccabe 14y agoThe novelty of the fart sounds is funny, but the JS implementation is fascinating.
- obviouslygreen 14y agoPresumably they did that just to avoid external dependencies. Talk about anal...
- krsunny 14y agoHow did they convert the mp3/ogg into strings?
- charonn0 14y agoBase64 encoded. See: https://en.wikipedia.org/wiki/Data_URI_scheme https://en.wikipedia.org/wiki/Data_URI_scheme
- verisimilitude 14y agoLove Base64 encoding... for anyone looking to optimize their CSS, check out Shaun Inman's CSS Cacheer... it can automatically inline images using that encoding: http://www.shauninman.com/archive/2008/05/30/check_out_css_cacheer http://www.shauninman.com/archive/2008/05/30/check_out_css_c... Sorry for slightly OT, but I really do love Base64...
- sc00ter 14y agoOr if you're on Rails, there's a little-known helper as part of the asset pipeline that will do this for you: #logo { background: url(<%= asset_data_uri 'logo.png' %>) }