-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·349 lines (304 loc) · 17.1 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<!DOCTYPE HTML>
<html>
<head>
<title>Waud - Javascript Web Audio Library</title>
<meta charset="utf-8"/>
<meta name="description" content="Web Audio Library with HTML5 audio fallback">
<meta name="keywords"
content="web,audio,waud,javaScript,library,html5,base64,audio sprite,sprite,ios,android,mp3,ogg,m4a,aac,waudsprite,waudbase64,waud.js,haxe,sound,sounds">
<meta name="author" content="Adi Reddy Mora">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="flattr:id" content="32j6wp">
<!--[if lte IE 8]>
<script src="js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="css/main.css"/>
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/ie8.css"/><![endif]-->
<!--[if lte IE 9]>
<link rel="stylesheet" href="css/ie9.css"/><![endif]-->
<link rel="shortcut icon" href="images/logo/32.png">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<style>
canvas {
pointer-events: none;
position: absolute;
left: 0px;
top: 0px;
z-index: 100;
}
body {
overflow-x: hidden;
}
</style>
<script src="js/waud.min.js"></script>
</head>
<body>
<canvas id="visualizer"></canvas>
<!-- Header -->
<section id="header">
<header class="major">
<img id="logo" width="128" height="128" class="logo"
src="images/logo/256.png" alt="waud.js"/>
<h1><span style="color: #E70000">WAUD</span><span style="color: #F3B607">.</span><span style="color: #32BEA6">JS</span></h1>
<p id="caption">Web Audio Library with HTML5 audio fallback.</p>
<p>
<a class="github-button" href="https://github.com/waud/waud" data-icon="octicon-star" data-count-href="/waud/waud/stargazers"
data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star waud/waud on GitHub">Star</a>
<a class="github-button" href="https://github.com/waud/waud/fork" data-icon="octicon-repo-forked" data-count-href="/waud/waud/network"
data-show-count="true" data-count-aria-label="# forks on GitHub" aria-label="Fork waud/waud on GitHub">Fork</a>
</p>
</header>
<div class="container">
<ul class="actions">
<li><a href="#one" class="button special scrolly">More Info</a></li>
</ul>
</div>
</section>
<!-- One -->
<section id="one" class="main special">
<div class="container">
<span class="image fit primary"><img src="images/pic01.jpg" alt=""/></span>
<div class="content">
<header class="major">
<h2>About</h2>
</header>
<p align="left"><strong>Waud</strong> is a simple and powerful web audio library that allows you to go beyond HTML5's <audio> tag and easily
take advantage of Web Audio API.<br/><br/>
The Web Audio API provides a powerful and versatile system for controlling audio capabilities of your web application. Waud abstracts Web Audio
API making it consistent and reliable across multiple platforms and browsers.<br/><br/>
It also falls back to HTML5 Audio on non-modern browsers where Web Audio API is not supported.<br/><br/>
Tested on multiple platforms (iOS, Android & Desktop) and browser versions (Chrome, IE, Edge, Firefox, Safari, Opera & Yandex) with the support
of <a href="https://www.browserstack.com/">BrowserStack</a>.<br/>
<p align="center"><img id="npm"></p>
</p>
</div>
<a href="#two" class="goto-next scrolly">Next</a>
</div>
</section>
<!-- Two -->
<section id="two" class="main special">
<div class="container">
<span class="image fit primary"><img src="images/pic02.jpg" alt=""/></span>
<div class="content">
<header class="major">
<h2>Features</h2>
</header>
<ul class="icons-grid">
<li>
<span class="icon major fa-archive"></span>
<h3>Base64 Pack</h3>
</li>
<li>
<span class="icon major fa-scissors"></span>
<h3>Audio Sprites</h3>
</li>
<li>
<span class="icon major fa-unlock"></span>
<h3>iOS Audio Unlock <sup>1</sup></h3>
</li>
<li>
<span class="icon major fa-volume-off"></span>
<h3>Auto Mute <sup>2</sup></h3>
</li>
<li>
<span class="icon major fa-code"></span>
<h3>Simple API</h3>
</li>
<li>
<span class="icon major fa-chain-broken"></span>
<h3>No Dependencies</h3>
</li>
<br>
<p align="left">
<sup>1</sup> Automatically unlocks audio on iOS devices on first touch.<br>
<sup>2</sup> Automatically mutes audio when the window is not in focus.
</p>
</ul>
</div>
<a href="#three" class="goto-next scrolly">Next</a>
</div>
</section>
<!-- Three -->
<section id="three" class="main special">
<div class="container">
<span class="image fit primary"><img src="images/pic03.jpg" alt=""/></span>
<div class="content">
<header class="major">
<h2>Tools</h2>
</header>
<p>
Waud supports base64 decoding across all browsers including IE 9. Use <a href="https://www.npmjs.com/package/waudbase64"
target="_blank">waudbase64</a> to generate base64 encoded JSON file.
You can pack multiple sounds into a single JSON file very similar to audio sprites. Click <a
href="https://github.com/adireddy/waudbase64#more-info" target="_blank">here</a> for more information.
</p>
<pre><code>npm install -g waudbase64</code></pre>
<ul class="actions">
<li><a href="https://github.com/adireddy/waudbase64" target="_blank" class="button special icon fa-download">waudbase64</a></li>
</ul>
<p>
Waud also supports audio sprites. Use <a href="https://www.npmjs.com/package/waudsprite"
target="_blank">waudsprite</a> to generate audio sprites.
It will combine multiple audio files into a single file and genetates a config JSON with the details of each sound.
</p>
<pre><code>npm install -g waudsprite</code></pre>
<ul class="actions">
<li><a href="https://github.com/adireddy/waudsprite" target="_blank" class="button special icon fa-download">waudsprite</a></li>
</ul>
<blockquote><i class="fa fa-info-circle" aria-hidden="true"></i> Waudbase64 is recommended over Waudsprite in terms of stability and reliability
across all browsers.
</blockquote>
</div>
<a href="#four" class="goto-next scrolly">Next</a>
</div>
</section>
<!-- Four -->
<section id="four" class="main special">
<div class="container">
<span class="image fit primary"><img src="images/pic06.jpg" alt=""/></span>
<div class="content">
<header class="major">
<h2>Player</h2>
</header>
<ul class="actions fit small">
<li><a id="load" class="button special small">Click here to Load Sounds (~10 MB)</a></li>
</ul>
<ul class="actions">
<li><a id="previous" class="button disabled special icon small fa-step-backward">Prev</a></li>
<li><a id="play" class="button disabled special icon small fa-play">Play</a></li>
<li><a id="next" class="button disabled special icon small fa-step-forward">Next</a></li>
</ul>
<h1 id="title">NO AUDIO</h1>
<canvas id="visualisation" style="border:1px solid #E70000;position: relative"></canvas>
<p id="info">Sounds from <a href="orangefreesounds.com" target="_blank">orangefreesounds.com</a></p>
<!--<header>
<h4> </h4>
<p>All the sounds used here are base64 encoded using <a href="https://github.com/adireddy/waudbase64" target="_blank">waudbase64</a> and loaded from a single JSON file.</p>
</header>-->
<header>
<h4> </h4>
<p>Note that the audio visualisation only works with Web Audio API so HTML5 audio fallback is disabled in this player.</p>
</header>
</div>
<a href="#footer" class="goto-next scrolly">Next</a>
</div>
</section>
<!-- Footer -->
<section id="footer">
<div class="container">
<header class="major">
<h2>Usage & Documentation</h2>
</header>
<p align="left">
To initialise waud.js (make sure to call this before loading sounds):<br>
<code>Waud.init();</code>
<br><br>
To play a blank sound and automatically unlock audio on iOS devices:<br>
<code>Waud.enableTouchUnlock(cb);</code>
<br><br>
To auto mute audio when the window is not in focus (switching tabs, minimising window, etc):<br>
<code>Waud.autoMute();</code>
<br><br>
To load a sound:<br>
<code>var bgSnd = new WaudSound("loop.mp3");</code>
</p>
For more info and samples visit: <br/><br/>
<ul class="actions">
<li><a href="https://github.com/waud/waud" target="_blank" class="button icon fa-github">GitHub Repo</a></li>
<li><a href="http://waud.github.io/api/" target="_blank" class="button icon fa-book">API Docs</a></li>
</ul>
<!--<a href="https://www.patreon.com/user?u=5392234" style="border-bottom: hidden"><img id="patreon" class="patreon"
src="images/patreon.png" alt="support me on patreon" /></a>-->
</div>
<footer>
<ul class="icons">
<li>
<a href="https://twitter.com/intent/tweet?related=adireddy&text=waud.js%20-%20Web%20Audio%20Library&url=http%3A%2F%2Fwaudjs.com&via=adireddy"
target="_blank" class="icon alt fa-twitter"><span class="label">Twitter</span></a></a></li>
<li><a href="https://www.facebook.com/sharer/sharer.php?u=http%3A//waudjs.com/" target="_blank" class="icon alt fa-facebook-official"><span
class="label">Facebook</span></a></a></li>
<li><a href="https://github.com/waud/waud" target="_blank" class="icon alt fa-github"><span class="label">Github</span></a></li>
<li><a href="https://www.npmjs.com/package/waud.js" target="_blank" class="icon alt fa-terminal"><span class="label">NPM</span></a></li>
<li><a href="mailto:[email protected]" target="_blank" class="icon alt fa-envelope"><span class="label">Email</span></a></li>
<!--<li><a href="https://www.patreon.com/adireddy" target="_blank" class="icon alt"><svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 8 8"
width="16px"
height="16px"
fill="#FFF">
<path d="M2.32081783.3678855c.869042-.40526652 1.88661925-.47774603 2.80665096-.20727372.80652418.2346745 1.53190822.73363407 2.0426921 1.3983242.5050198.6523156.79854318 1.4641745.82647667 2.28752405.0354711.8511923-.21060967 1.71122356-.6952336 2.4134793-.71030882 1.0518368-1.9482503 1.72713368-3.22254963 1.73950823-.63803645.0008839-1.2760729.00044195-1.91366597 0 .00532067-1.34042898.0004434-2.68085797.00310373-4.0217289.00221694-.50647268.23011877-1.00499028.60921618-1.34131288.36180524-.3279256.85973083-.5002854 1.3474585-.46404565.50457642.03093638.98831357.2859405 1.30267622.68015833.3232304.3968695.46422805.93295272.38131434 1.4376576-.08114014.53122177-.41368172 1.01603898-.87790977 1.2882791-.5373872.3252739-1.2406018.3345548-1.7935076.04021728.00044338.43487706-.0008868.86975412.00044338 1.30463118.4934917.14407512 1.02201113.16838228 1.52392723.0539177.7431196-.16219502 1.4144102-.6174017 1.8444973-1.24187455.40969124-.5855814.59946164-1.31788962.52851943-2.02810043-.06030086-.6514317-.34052257-1.27944013-.78302457-1.7620476-.41013462-.4507872-.95860653-.77561914-1.55363427-.913507-.6837055-.162195-1.42372137-.07866678-2.05200326.23600036C1.64553673 1.7542771.962718 2.8206982.95207668 3.932198.95030312 5.2876532.95163328 6.6435504.9511899 7.99944755c-.3165796.0008839-.63360256.00044195-.95062554.00044195-.0004434-1.32584468.0004434-2.65168938-.0004434-3.97709212-.00443387-.56569374.11306415-1.13227137.3440697-1.6493508C.73215587 1.49662128 1.44778534.7691745 2.32081784.3678855z" />
</svg></a></li>-->
</ul>
<a href="" target="_blank" class="social-icon facebook"></a>
<ul class="copyright">
<li>Created by <a href="https://github.com/adireddy" target="_blank">Adi Reddy Mora</a></li>
<li>License: <a href="http://opensource.org/licenses/MIT" target="_blank">MIT</a></li>
<li>Design: <a href="http://html5up.net" target="_blank">HTML5 UP</a></li>
</ul>
<ul class="copyright">
<li>Thanks to <a href="https://www.browserstack.com/">BrowserStack</a> for providing real browser testing infrastructure.</li>
</ul>
</footer>
</section>
<!-- Scripts -->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.scrollex.min.js"></script>
<script src="js/jquery.scrolly.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/util.js"></script>
<!--[if lte IE 8]>
<script src="js/ie/respond.min.js"></script><![endif]-->
<script src="js/main.js"></script>
<a href="https://github.com/waud/waud" class="github-corner">
<svg id="github" width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: absolute; top: 0; border: 0; right: 0;">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg>
</a>
<style>.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%, 100% {
transform: rotate(0)
}
20%, 60% {
transform: rotate(-25deg)
}
40%, 80% {
transform: rotate(10deg)
}
}
@media (max-width: 500px) {
.github-corner:hover .octo-arm {
animation: none
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
}</style>
<script>
window.onload = init;
function init() {
var canvas = document.getElementById("visualisation");
var ctx = canvas.getContext("2d");
ctx.font = "15px Raleway";
ctx.fillStyle = "#E70000";
ctx.textAlign = "center";
ctx.fillText("AUDIO VISUALISER", canvas.width / 2, canvas.height / 2);
setNPMBadges();
}
window.onresize = function () {
setNPMBadges();
};
function setNPMBadges() {
document.getElementById("npm").src = "https://nodei.co/npm/waud.js.png?downloads=true&downloadRank=true&mini=" + !(window.innerWidth > 420);
document.getElementById("caption").style.visibility = (window.innerHeight < 480) ? "hidden" : "visible";
document.getElementById("github").style.top = WaudUtils.isiOS() ? "25px" : "0px";
}
</script>
<script src="js/audio-player.js"></script>
</body>
</html>