jquery.shitsound.js - a shit sound player for web browsers
Yesterday, I made the first release of shitsound.
jquery.shitsound.js is a shit sound player for web browsers.
shitsound detects which implementation to use at init time.
Each implementation is kept separate in the code base, and it is fairly easy to extend with other implementation. The html5 implementation is separate from the soundmanager1 implementation for example. I plan on implementing a phonegap implementation in the future.
If you'd like to see another JavaScript audio engine supported, please let me know.
Yes, it does support netscape navigator 3+. As well as old versions of internet explorer that don't have flash installed, or have old versions of flash installed.
Used like this:
- Listen (demo): http://rene.f0o.com/~rene/shitsound
- Source code: https://www.bitbucket.org/illume/shitsound
$.snd.init({}, function () { // we are ready to play sounds! Brilliant. $.snd.play('hello'); });
- shitsound only does a few things with sound::
- play, stop, stopAll
- jquery.awesound.js might do:
- changing volume, pitch, playing with a different tempo, playing in stereo, 3d sound, etc.
shitsound detects which implementation to use at init time.
It currently requires jquery, since I use jquery. However it could quite easily drop the jquery dependency with some work. Other dependencies are soundmanager 1 and soundmanager 2, as well as (optionally) swfobject. These are all bundled in ready to use though.
- html5, using the html5 audio tag.
- embed, for using the embed tag.
- soundmanager1, for old flash 7.
- soundmanager2, for modern flash (8,9,10+).
- empty, pretend implementation that does nothing.
Each implementation is kept separate in the code base, and it is fairly easy to extend with other implementation. The html5 implementation is separate from the soundmanager1 implementation for example. I plan on implementing a phonegap implementation in the future.
If you'd like to see another JavaScript audio engine supported, please let me know.
Yes, it does support netscape navigator 3+. As well as old versions of internet explorer that don't have flash installed, or have old versions of flash installed.
preparing your audio
Because sound support on the web is shit, you need to prepare your audio in various different formats for it to work cross platform.You need a .wav file, a .mp3 file, and an .ogg file to support all platforms.
It might not be a good idea to include big .wav files for large amounts of audio like songs though. Because they can be 10 times larger than a lossily compressed mp3 or ogg file. But if you want full browser support, then .wav files are required.
The ffmpeg is quite a common powerhouse of a multimedia tool. It is available on OSX through brew, or macports. It can even convert audio for you.
- ffmpeg -i file.wav file.mp3
- ffmpeg -i file.wav file.ogg
preparing your webserver
- If you use nginx you might need to modify your /etc/nginx/mime.types file for oggs::
- audio/ogg ogg;
future
Maybe these things will be done in the future.
- volume control. This is possible with all backends.
- Better browser detection, and blacklisting of bad html5 audio engines.
- wider testing and debugging.
Comments
Sub Kuch
Sub Kuch