Audio Library for playing multi-channel sounds in any browser without Flash
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


HTML 5 <audio> is awesome but individual browser implementations are still lacking.

* FireFox doesn't play mp3 (without putting in 'mad' effort)
* Internet Explorer doesn't handle multiple channels very well (if at all)
* Chrome is the best (what else is new?) but even Chrome hangs or loses audio output under certain situations

These are only a few of the problems solved by jThump -- a multi-channel js audio library.

Wouldn't it be great if you just had to write a single line of code to play any key on the piano in any browser without Flash?

jThump makes it all possible:

// play the lowest piano key (1)
jThump( 1, 'piano' );

// play the highest piano key (88)
jThump( 88, 'piano' );

The idea came to me while listening to audio in one browser tab while another browser tab started playing over the top of it.
I wondered if I could dynamically create a bunch of tiny web pages that each play a different sound when opened and then chain them together inside invisible iframes that are created just long enough to play the audio and then go away.
The result turned out better than expected and is probably good enough to be used in most HTML 5 games (some lagging issues at first but they quickly ease up as the bytes get cached)

Here is a working demo on my personal site:

jThump currently supports:
* ALL 88 piano keys
* 50 drum kit sounds
* 60 flute notes

Adding a stack of custom sounds is easy so join in and add your own instruments to be jThumped!  >>  jThump( 1, 'drums' );

Thanks for playing,