-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
38 lines (23 loc) · 1.53 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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:
http://davealger.com/apps/jthump
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,
run-time