-
Notifications
You must be signed in to change notification settings - Fork 5
/
testSfx.html
37 lines (28 loc) · 1016 Bytes
/
testSfx.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
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1">
<title>test sfx</title>
</head>
<body>
<script src="vendor/jsfx.js"></script>
<script src="sfx.js"></script>
<div id="effects"></div>
<script>
var sampleNames = 'start piece line denied more'.split(' ');
var sfx = setupSfx(1); // 2=WEBAUDIO, 1=AUDIOELEMENT, 0=NONE
// create UI
var effectsEl = document.getElementById('effects');
sampleNames.forEach(function(name) {
var buttonEl = document.createElement('button');
buttonEl.innerHTML = name;
effectsEl.appendChild(buttonEl);
});
effectsEl.addEventListener('click', function(ev) {
var name = ev.target.innerHTML;
sfx[name]();
});
</script>
</body>
</html>