-
Notifications
You must be signed in to change notification settings - Fork 5
/
demo.html
41 lines (31 loc) · 892 Bytes
/
demo.html
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
39
40
41
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Abbey Load demo</title>
</head>
<body>
</body>
<script src="abbey-load.js"></script>
<script>
/*
Simple Abbey Load demo by @alvinsight
*/
var context;
var source;
if (typeof AudioContext !== "undefined") {
context = new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
context = new webkitAudioContext();
} else {
throw new Error('Web Audio should be available in order to use Abbey Load');
}
var loader = new AbbeyLoad([{'sound' : 'path/to/sound.mp3'}],filesLoaded);
function filesLoaded(buffers){
source = context.createBufferSource();
source.buffer = buffers['sound'];
source.connect(context.destination);
source.start(0);
}
</script>
</html>