forked from hvianna/audioMotion-analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi.html
200 lines (172 loc) · 6.28 KB
/
multi.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>audioMotion-analyzer multi-instance demo</title>
<link href="https://fonts.googleapis.com/css?family=Orbitron:900" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
</head>
<body>
<header>
<h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | multi-instance demo</h1>
<ul class="header-nav">
<li><a href="index.html">Demos</a></li>
<li><a href="https://audiomotion.dev">Home</a></li>
<li><a href="https://github.com/hvianna/audioMotion-analyzer/tree/master/demo/src/multi.js">View on GitHub</a></li>
</ul>
</header>
<p> </p>
<div id="analyzer-block">
<div class="main">
<div id="container0"></div>
<audio id="audio" controls crossorigin="anonymous"></audio>
</div>
<div class="aside">
<div id="container1"></div>
<div id="container2"></div>
</div>
</div>
<div class="flex">
<div>
Load audio file:
<input type="file" id="uploadFile" accept="audio/*">
</div>
<div>
<button data-prop="isOn" data-func="toggleAnalyzer">toggleAnalyzer()</button>
<button data-prop="isFullscreen" data-func="toggleFullscreen">toggleFullscreen()</button>
</div>
</div>
<div class="analyzer-configuration center">
<div class="selector">
Selected analyzer:
<label><input type="radio" name="analyzer" value="0" checked> Main </label>
<label><input type="radio" name="analyzer" value="1"> Top </label>
<label><input type="radio" name="analyzer" value="2"> Bottom</label>
</div>
<div class="box">
<label class="label">mode
<select data-setting="mode">
<option value="0">0 - Discrete frequencies</option>
<option value="1">1 - 1/24th octave bands</option>
<option value="2">2 - 1/12th octave bands</option>
<option value="3">3 - 1/8th octave bands</option>
<option value="4">4 - 1/6th octave bands</option>
<option value="5">5 - 1/4th octave bands</option>
<option value="6">6 - 1/3rd octave bands</option>
<option value="7">7 - Half octave bands</option>
<option value="8">8 - Full octave bands</option>
<option value="10">10 - Line / Area graph</option>
</select>
</label>
<label class="label">gradient
<select data-setting="gradient">
<option value="classic">classic</option>
<option value="prism">prism</option>
<option value="rainbow">rainbow</option>
</select>
</label>
<label class="label">fftSize
<select data-setting="fftSize">
<option value="1024">1024</option>
<option value="2048">2048</option>
<option value="4096">4096</option>
<option value="8192">8192</option>
<option value="16384">16384</option>
<option value="32768">32768</option>
</select>
</label>
<label class="label">Frequency range
<select id="range">
<option data-min="20" data-max="22000">20Hz - 22KHz</option>
<option data-min="30" data-max="16000">30Hz - 16KHz</option>
<option data-min="100" data-max="10000">100Hz - 10KHz</option>
</select>
</label>
<label class="label">Sensitivity
<input type="range" id="sensitivity" min="0" max="4">
<div class="value"></div>
</label>
<label class="label">smoothing
<input type="range" min="0" max=".9" step=".1" data-setting="smoothing">
<div class="value"></div>
</label>
<label class="label">volume
<input type="range" min="0" max="1" step=".1" data-setting="volume">
<div class="value"></div>
</label>
</div>
<div class="box center">
<fieldset>
<legend>modes 1-8 only</legend>
<label class="label">barSpace
<select data-setting="barSpace">
<option value="0">0</option>
<option value="0.1">0.1</option>
<option value="0.25">0.25</option>
<option value="0.5">0.5</option>
<option value="0.75">0.75</option>
<option value="1">1 (legacy)</option>
</select>
</label>
</fieldset>
<fieldset>
<legend>mode 10 only</legend>
<label class="label">lineWidth
<input type="range" id="line_width" min="0" max="9" step="1" data-setting="lineWidth">
<div class="value"></div>
</label>
<label class="label">fillAlpha
<input type="range" id="fill_alpha" min="0" max="1" step=".1" data-setting="fillAlpha">
<div class="value"></div>
</label>
</fieldset>
<fieldset>
<legend>Radial effect</legend>
<button data-prop="radial">radial</button>
<label class="label">spinSpeed
<input type="range" min="-5" max="5" step="1" data-setting="spinSpeed">
<div class="value"></div>
</label>
</fieldset>
<fieldset>
<legend>Reflex effect</legend>
<label class="label">reflexRatio
<input type="range" min="0" max=".9" step=".1" data-setting="reflexRatio">
<div class="value"></div>
</label>
<label class="label">reflexAlpha
<input type="range" min="0" max="1" step=".05" data-setting="reflexAlpha">
<div class="value"></div>
</label>
<label class="label">reflexBright
<input type="range" min="0" max="2" step=".1" data-setting="reflexBright">
<div class="value"></div>
</label>
<button data-prop="reflexFit">reflexFit</button>
</fieldset>
</div>
<div class="box">
<button data-prop="showBgColor">showBgColor</button>
<button data-prop="showPeaks">showPeaks</button>
<button data-prop="showLeds">showLeds</button>
<button data-prop="lumiBars">lumiBars</button>
<button data-prop="radial">radial</button>
<button data-prop="showScaleX">showScaleX</button>
<button data-prop="showScaleY">showScaleY</button>
<button data-prop="stereo">stereo</button>
<button data-prop="splitGradient">splitGradient</button>
<button data-prop="loRes">loRes</button>
<button data-prop="showFPS">showFPS</button>
</div>
</div>
<div class="credits">
<strong>audioMotion-analyzer v<span id="version"></span></strong> Copyright © 2018-2021 Henrique Avila Vianna. Source code available on <a href="https://github.com/hvianna/audioMotion-analyzer">GitHub</a>.
</div>
<script src="multi.js" type="module"></script>
<script>
if ( location.href.startsWith('file://') )
alert("This demo won't work when loaded via file:// protocol.\nSee the README file inside the demo folder for more information.");
</script>
</body>
</html>