Skip to content

Commit 0075b0f

Browse files
committed
MDN audio worklet example. Add test page
1 parent 20b306a commit 0075b0f

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>AudioWorklet Demo</title>
5+
<meta charset="utf-8"/>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
7+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8+
9+
<!-- import the webpage's stylesheet -->
10+
<link rel="stylesheet" href="style.css"/>
11+
12+
<!-- import the webpage's javascript file -->
13+
<script src="script.js" defer></script>
14+
</head>
15+
<body>
16+
<h1>AudioWorklet Demo</h1>
17+
18+
<p>
19+
This page is a demo for the <code>AudioWorklet</code> API, which lets you
20+
process audio in the background using a worklet.
21+
</p>
22+
23+
<button id="toggle">Toggle Sound</button>
24+
25+
<div class="control-box">
26+
<div class="control">
27+
<span class="control-label">
28+
<label for="osc-gain">Oscillator gain:</label>
29+
</span>
30+
<input
31+
type="range"
32+
id="osc-gain"
33+
name="osc-gain"
34+
min="0.0"
35+
max="1.0"
36+
step="0.05"
37+
value="0.1"
38+
/>
39+
</div>
40+
41+
<div class="control">
42+
<span class="control-label">
43+
<label for="hiss-gain">Hiss gain:</label>
44+
</span>
45+
<input
46+
type="range"
47+
id="hiss-gain"
48+
name="hiss-gain"
49+
min="0.0"
50+
max="1.0"
51+
step="0.05"
52+
value="0.2"
53+
/>
54+
</div>
55+
</div>
56+
</body>
57+
</html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* CSS files add styling rules to your content */
2+
3+
body {
4+
font-family: helvetica, arial, sans-serif;
5+
margin: 2em;
6+
}
7+
8+
h1 {
9+
font-style: bold;
10+
color: #330000;
11+
}
12+
13+
.control-box {
14+
margin-top: 1em;
15+
width: 20em;
16+
border: 2px solid #333;
17+
border-radius: 2em;
18+
padding: 1em;
19+
}
20+
21+
.control {
22+
margin-bottom: 1em;
23+
}
24+
25+
.control input {
26+
width: 14em;
27+
left: 20em;
28+
float: right;
29+
}

0 commit comments

Comments
 (0)