speaker-calibration 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +72 -0
- package/.eslintrc.json +40 -0
- package/.gitignore +78 -0
- package/.prettierignore +70 -0
- package/.prettierrc +15 -0
- package/LICENSE +20 -20
- package/README.md +133 -133
- package/__mocks__/fileMock.js +1 -0
- package/__mocks__/styleMock.js +1 -0
- package/babel.config.js +3 -0
- package/coverage/clover.xml +71 -0
- package/coverage/coverage-final.json +224 -0
- package/coverage/lcov-report/PythonServerInterface.js.html +265 -0
- package/coverage/lcov-report/base.css +354 -0
- package/coverage/lcov-report/block-navigation.js +82 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +123 -0
- package/coverage/lcov-report/prettify.css +101 -0
- package/coverage/lcov-report/prettify.js +937 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +189 -0
- package/coverage/lcov-report/src/index.html +121 -0
- package/coverage/lcov-report/src/server/PythonServerInterface.js.html +268 -0
- package/coverage/lcov-report/src/server/index.html +123 -0
- package/coverage/lcov-report/src/tasks/audioCalibrator.js.html +499 -0
- package/coverage/lcov-report/src/tasks/audioRecorder.js.html +412 -0
- package/coverage/lcov-report/src/tasks/index.html +143 -0
- package/coverage/lcov-report/src/tasks/volume/index.html +123 -0
- package/coverage/lcov-report/src/tasks/volume/volume.js.html +409 -0
- package/coverage/lcov-report/src/utils.js.html +172 -0
- package/coverage/lcov.info +91 -0
- package/dist/example/Queen-Bohemian_Rhapsody.wav +0 -0
- package/dist/example/Queen-Bohemian_Rhapsody_g_filtered.wav +0 -0
- package/dist/example/index.html +47 -0
- package/dist/example/listener.html +89 -0
- package/dist/example/server.js +49 -0
- package/dist/example/speaker.html +126 -0
- package/dist/example/speakerUI.js +217 -0
- package/dist/example/styles.css +40 -0
- package/dist/main.js +1 -1
- package/dist/mlsGen.js +6814 -6814
- package/dist/mlsGen.wasm +0 -0
- package/doc/AudioCalibrator.html +417 -0
- package/doc/AudioPeer.html +251 -0
- package/doc/AudioRecorder.html +195 -0
- package/doc/ImpulseResponse.html +215 -0
- package/doc/Listener.html +308 -0
- package/doc/MlsGenInterface.html +226 -0
- package/doc/MyEventEmitter.html +274 -0
- package/doc/PythonServerAPI.html +109 -0
- package/doc/Speaker-Calibration-UML-Diagram.png +0 -0
- package/doc/Speaker.html +276 -0
- package/doc/Takes%20a%20target%20element%20where%20html%20elements%20will%20be%20appended..html +128 -0
- package/doc/Takes%20the%20url%20of%20the%20current%20site%0Aand%20a%20target%20element%20where%20html%20elements%20will%20be%20appended..html +138 -0
- package/doc/Takes%20the%20url%20of%20the%20current%20site%20and%20a%20target%20element%20where%20html%20elements%20will%20be%20appended..html +137 -0
- package/doc/Volume.html +88 -0
- package/doc/audioCalibrator.js.html +179 -0
- package/doc/audioPeer.js.html +175 -0
- package/doc/audioRecorder.js.html +163 -0
- package/doc/creates%20a%20new%20AudioRecorder%20instance.%20%0ASets%20up%20the%20audio%20context%20and%20file%20reader..html +114 -0
- package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/global.html +308 -0
- package/doc/index.html +58 -0
- package/doc/listener.js.html +170 -0
- package/doc/mlsGen_mlsGenInterface.js.html +117 -0
- package/doc/myEventEmitter.js.html +124 -0
- package/doc/peer-connection_audioPeer.js.html +188 -0
- package/doc/peer-connection_listener.js.html +311 -0
- package/doc/peer-connection_speaker.js.html +381 -0
- package/doc/sc-activity-diagram.png +0 -0
- package/doc/scripts/linenumber.js +25 -0
- package/doc/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/doc/scripts/prettify/lang-css.js +24 -0
- package/doc/scripts/prettify/prettify.js +640 -0
- package/doc/server_PythonServerAPI.js.html +160 -0
- package/doc/speaker.js.html +248 -0
- package/doc/styles/jsdoc-default.css +371 -0
- package/doc/styles/prettify-jsdoc.css +111 -0
- package/doc/styles/prettify-tomorrow.css +163 -0
- package/doc/tasks_audioCalibrator.js.html +207 -0
- package/doc/tasks_audioRecorder.js.html +190 -0
- package/doc/tasks_impulse-response_impulseResponse.js.html +442 -0
- package/doc/tasks_impulse-response_mlsGen_mlsGenInterface.js.html +175 -0
- package/doc/tasks_volume_volume.js.html +185 -0
- package/doc/utils.js.html +105 -0
- package/jest.config.js +173 -0
- package/netlify.toml +27 -0
- package/package.json +67 -66
- package/src/index.html +21 -0
- package/src/main.js +21 -0
- package/src/myEventEmitter.js +83 -0
- package/src/peer-connection/audioPeer.js +151 -0
- package/src/peer-connection/listener.js +251 -0
- package/src/peer-connection/peerErrors.js +25 -0
- package/src/peer-connection/speaker.js +346 -0
- package/src/server/PythonServerAPI.js +117 -0
- package/src/tasks/audioCalibrator.js +218 -0
- package/src/tasks/audioRecorder.js +148 -0
- package/src/tasks/impulse-response/impulseResponse.js +436 -0
- package/src/tasks/impulse-response/mlsGen/mlsGen.cpp +99 -0
- package/src/tasks/impulse-response/mlsGen/mlsGen.hpp +304 -0
- package/src/tasks/impulse-response/mlsGen/mlsGenInterface.js +131 -0
- package/src/tasks/impulse-response/mlsGen/mlsGenTest.cpp +181 -0
- package/src/tasks/volume/volume.cpp +3 -0
- package/src/tasks/volume/volume.hpp +23 -0
- package/src/tasks/volume/volume.js +157 -0
- package/src/utils.js +55 -0
- package/webpack.config.js +37 -0
- package/README +0 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for src/utils.js</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../base.css" />
|
|
8
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
.coverage-summary .sorter {
|
|
12
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
</head>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
<div class="wrapper">
|
|
19
|
+
<div class="pad1">
|
|
20
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> utils.js</h1>
|
|
21
|
+
<div class="clearfix">
|
|
22
|
+
<div class="fl pad1y space-right2">
|
|
23
|
+
<span class="strong">48.38% </span>
|
|
24
|
+
<span class="quiet">Statements</span>
|
|
25
|
+
<span class="fraction">15/31</span>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="fl pad1y space-right2">
|
|
29
|
+
<span class="strong">100% </span>
|
|
30
|
+
<span class="quiet">Branches</span>
|
|
31
|
+
<span class="fraction">0/0</span>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="fl pad1y space-right2">
|
|
35
|
+
<span class="strong">0% </span>
|
|
36
|
+
<span class="quiet">Functions</span>
|
|
37
|
+
<span class="fraction">0/2</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="fl pad1y space-right2">
|
|
41
|
+
<span class="strong">48.38% </span>
|
|
42
|
+
<span class="quiet">Lines</span>
|
|
43
|
+
<span class="fraction">15/31</span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<p class="quiet">
|
|
47
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>,
|
|
48
|
+
<em>p</em> or <em>k</em> for the previous block.
|
|
49
|
+
</p>
|
|
50
|
+
<template id="filterTemplate">
|
|
51
|
+
<div class="quiet">
|
|
52
|
+
Filter:
|
|
53
|
+
<input oninput="onInput()" type="search" id="fileSearch" />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="status-line low"></div>
|
|
58
|
+
<pre><table class="coverage">
|
|
59
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
60
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
61
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
62
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
63
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
64
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
65
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
66
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
67
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
68
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
69
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
70
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
71
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
72
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
73
|
+
<a name='L15'></a><a href='#L15'>15</a>
|
|
74
|
+
<a name='L16'></a><a href='#L16'>16</a>
|
|
75
|
+
<a name='L17'></a><a href='#L17'>17</a>
|
|
76
|
+
<a name='L18'></a><a href='#L18'>18</a>
|
|
77
|
+
<a name='L19'></a><a href='#L19'>19</a>
|
|
78
|
+
<a name='L20'></a><a href='#L20'>20</a>
|
|
79
|
+
<a name='L21'></a><a href='#L21'>21</a>
|
|
80
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
|
81
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
|
82
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
|
83
|
+
<a name='L25'></a><a href='#L25'>25</a>
|
|
84
|
+
<a name='L26'></a><a href='#L26'>26</a>
|
|
85
|
+
<a name='L27'></a><a href='#L27'>27</a>
|
|
86
|
+
<a name='L28'></a><a href='#L28'>28</a>
|
|
87
|
+
<a name='L29'></a><a href='#L29'>29</a>
|
|
88
|
+
<a name='L30'></a><a href='#L30'>30</a>
|
|
89
|
+
<a name='L31'></a><a href='#L31'>31</a>
|
|
90
|
+
<a name='L32'></a><a href='#L32'>32</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
91
|
+
<span class="cline-any cline-yes">1x</span>
|
|
92
|
+
<span class="cline-any cline-yes">1x</span>
|
|
93
|
+
<span class="cline-any cline-yes">1x</span>
|
|
94
|
+
<span class="cline-any cline-yes">1x</span>
|
|
95
|
+
<span class="cline-any cline-yes">1x</span>
|
|
96
|
+
<span class="cline-any cline-no"> </span>
|
|
97
|
+
<span class="cline-any cline-no"> </span>
|
|
98
|
+
<span class="cline-any cline-no"> </span>
|
|
99
|
+
<span class="cline-any cline-yes">1x</span>
|
|
100
|
+
<span class="cline-any cline-yes">1x</span>
|
|
101
|
+
<span class="cline-any cline-yes">1x</span>
|
|
102
|
+
<span class="cline-any cline-yes">1x</span>
|
|
103
|
+
<span class="cline-any cline-yes">1x</span>
|
|
104
|
+
<span class="cline-any cline-yes">1x</span>
|
|
105
|
+
<span class="cline-any cline-yes">1x</span>
|
|
106
|
+
<span class="cline-any cline-no"> </span>
|
|
107
|
+
<span class="cline-any cline-no"> </span>
|
|
108
|
+
<span class="cline-any cline-no"> </span>
|
|
109
|
+
<span class="cline-any cline-no"> </span>
|
|
110
|
+
<span class="cline-any cline-no"> </span>
|
|
111
|
+
<span class="cline-any cline-no"> </span>
|
|
112
|
+
<span class="cline-any cline-no"> </span>
|
|
113
|
+
<span class="cline-any cline-no"> </span>
|
|
114
|
+
<span class="cline-any cline-no"> </span>
|
|
115
|
+
<span class="cline-any cline-no"> </span>
|
|
116
|
+
<span class="cline-any cline-no"> </span>
|
|
117
|
+
<span class="cline-any cline-no"> </span>
|
|
118
|
+
<span class="cline-any cline-no"> </span>
|
|
119
|
+
<span class="cline-any cline-yes">1x</span>
|
|
120
|
+
<span class="cline-any cline-yes">1x</span>
|
|
121
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
|
122
|
+
* Utlity function to pause execution for a given time
|
|
123
|
+
* @param {number} seconds
|
|
124
|
+
* @returns {Promise}
|
|
125
|
+
*/
|
|
126
|
+
const sleep = <span class="fstat-no" title="function not covered" >seconds =></span>
|
|
127
|
+
<span class="cstat-no" title="statement not covered" > new Promise(resolve => {</span>
|
|
128
|
+
<span class="cstat-no" title="statement not covered" > setTimeout(resolve, seconds * 1000);</span>
|
|
129
|
+
<span class="cstat-no" title="statement not covered" > });</span>
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Uiltity function to create and save a CSV file from a buffer
|
|
133
|
+
* @param {*} data
|
|
134
|
+
* @param {*} filename
|
|
135
|
+
*/
|
|
136
|
+
const saveToCSV = <span class="fstat-no" title="function not covered" >(data, filename = 'recordedMLSignal.csv') => {</span>
|
|
137
|
+
<span class="cstat-no" title="statement not covered" > // console.log(data)</span>
|
|
138
|
+
<span class="cstat-no" title="statement not covered" > let csvContent = 'data:text/csv;charset=utf-8,';</span>
|
|
139
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
140
|
+
<span class="cstat-no" title="statement not covered" > data.forEach((val, idx) => {</span>
|
|
141
|
+
<span class="cstat-no" title="statement not covered" > csvContent += `${idx},${val}\r\n`;</span>
|
|
142
|
+
<span class="cstat-no" title="statement not covered" > });</span>
|
|
143
|
+
<span class="cstat-no" title="statement not covered" > const encodedUri = encodeURI(csvContent);</span>
|
|
144
|
+
<span class="cstat-no" title="statement not covered" > const link = document.createElement('a');</span>
|
|
145
|
+
<span class="cstat-no" title="statement not covered" > link.setAttribute('href', encodedUri);</span>
|
|
146
|
+
<span class="cstat-no" title="statement not covered" > link.setAttribute('download', filename);</span>
|
|
147
|
+
<span class="cstat-no" title="statement not covered" > document.body.appendChild(link);</span>
|
|
148
|
+
<span class="cstat-no" title="statement not covered" > link.click();</span>
|
|
149
|
+
<span class="cstat-no" title="statement not covered" >};</span>
|
|
150
|
+
|
|
151
|
+
export {sleep, saveToCSV};
|
|
152
|
+
</pre></td></tr></table></pre>
|
|
153
|
+
|
|
154
|
+
<div class="push"></div>
|
|
155
|
+
<!-- for sticky footer -->
|
|
156
|
+
</div>
|
|
157
|
+
<!-- /wrapper -->
|
|
158
|
+
<div class="footer quiet pad2 space-top1 center small">
|
|
159
|
+
Code coverage generated by
|
|
160
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
161
|
+
at Thu Apr 21 2022 00:46:58 GMT-0400 (Eastern Daylight Time)
|
|
162
|
+
</div>
|
|
163
|
+
<script src="../prettify.js"></script>
|
|
164
|
+
<script>
|
|
165
|
+
window.onload = function () {
|
|
166
|
+
prettyPrint();
|
|
167
|
+
};
|
|
168
|
+
</script>
|
|
169
|
+
<script src="../sorter.js"></script>
|
|
170
|
+
<script src="../block-navigation.js"></script>
|
|
171
|
+
</body>
|
|
172
|
+
</html>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
TN:
|
|
2
|
+
SF:src/server/PythonServerInterface.js
|
|
3
|
+
FN:7,<static_initializer>
|
|
4
|
+
FN:13,PythonServerInterface
|
|
5
|
+
FN:23,<instance_members_initializer>
|
|
6
|
+
FN:23,getImpulseResponse
|
|
7
|
+
FN:30,getVolumeCalibration
|
|
8
|
+
FN:49,asyncEmit
|
|
9
|
+
FNF:6
|
|
10
|
+
FNH:6
|
|
11
|
+
FNDA:1,<static_initializer>
|
|
12
|
+
FNDA:2,PythonServerInterface
|
|
13
|
+
FNDA:2,<instance_members_initializer>
|
|
14
|
+
FNDA:1,getImpulseResponse
|
|
15
|
+
FNDA:1,getVolumeCalibration
|
|
16
|
+
FNDA:2,asyncEmit
|
|
17
|
+
DA:1,1
|
|
18
|
+
DA:2,1
|
|
19
|
+
DA:3,1
|
|
20
|
+
DA:4,1
|
|
21
|
+
DA:5,1
|
|
22
|
+
DA:6,1
|
|
23
|
+
DA:7,1
|
|
24
|
+
DA:8,1
|
|
25
|
+
DA:9,1
|
|
26
|
+
DA:10,1
|
|
27
|
+
DA:11,1
|
|
28
|
+
DA:12,1
|
|
29
|
+
DA:13,1
|
|
30
|
+
DA:14,2
|
|
31
|
+
DA:15,2
|
|
32
|
+
DA:16,2
|
|
33
|
+
DA:17,2
|
|
34
|
+
DA:18,2
|
|
35
|
+
DA:19,2
|
|
36
|
+
DA:20,2
|
|
37
|
+
DA:21,2
|
|
38
|
+
DA:22,1
|
|
39
|
+
DA:23,1
|
|
40
|
+
DA:24,1
|
|
41
|
+
DA:25,1
|
|
42
|
+
DA:26,1
|
|
43
|
+
DA:27,1
|
|
44
|
+
DA:28,1
|
|
45
|
+
DA:29,2
|
|
46
|
+
DA:30,2
|
|
47
|
+
DA:31,1
|
|
48
|
+
DA:32,1
|
|
49
|
+
DA:33,1
|
|
50
|
+
DA:34,1
|
|
51
|
+
DA:35,0
|
|
52
|
+
DA:36,0
|
|
53
|
+
DA:37,0
|
|
54
|
+
DA:38,0
|
|
55
|
+
DA:39,0
|
|
56
|
+
DA:40,0
|
|
57
|
+
DA:41,0
|
|
58
|
+
DA:42,0
|
|
59
|
+
DA:43,0
|
|
60
|
+
DA:44,0
|
|
61
|
+
DA:45,0
|
|
62
|
+
DA:46,0
|
|
63
|
+
DA:47,0
|
|
64
|
+
DA:48,2
|
|
65
|
+
DA:49,2
|
|
66
|
+
DA:50,2
|
|
67
|
+
DA:51,2
|
|
68
|
+
DA:52,2
|
|
69
|
+
DA:53,0
|
|
70
|
+
DA:54,0
|
|
71
|
+
DA:55,2
|
|
72
|
+
DA:56,0
|
|
73
|
+
DA:57,0
|
|
74
|
+
DA:58,2
|
|
75
|
+
DA:59,2
|
|
76
|
+
DA:60,1
|
|
77
|
+
DA:61,1
|
|
78
|
+
DA:62,1
|
|
79
|
+
LF:62
|
|
80
|
+
LH:45
|
|
81
|
+
BRDA:7,0,0,1
|
|
82
|
+
BRDA:13,1,0,2
|
|
83
|
+
BRDA:23,2,0,2
|
|
84
|
+
BRDA:23,3,0,1
|
|
85
|
+
BRDA:30,4,0,1
|
|
86
|
+
BRDA:34,5,0,0
|
|
87
|
+
BRDA:49,6,0,2
|
|
88
|
+
BRDA:50,7,0,2
|
|
89
|
+
BRF:8
|
|
90
|
+
BRH:7
|
|
91
|
+
end_of_record
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
|
6
|
+
<title>Sound Check</title>
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
|
|
10
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
11
|
+
<!--CSS-->
|
|
12
|
+
<link href="../example/styles.css" rel="stylesheet" typ="text/css" />
|
|
13
|
+
<link
|
|
14
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
|
15
|
+
rel="stylesheet"
|
|
16
|
+
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
|
|
17
|
+
crossorigin="anonymous"
|
|
18
|
+
/>
|
|
19
|
+
</head>
|
|
20
|
+
|
|
21
|
+
<body>
|
|
22
|
+
<!--[if lt IE 8]>
|
|
23
|
+
<p class="browserupgrade">
|
|
24
|
+
You are using an <strong>outdated</strong> browser. Please
|
|
25
|
+
<a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.
|
|
26
|
+
</p>
|
|
27
|
+
<![endif]-->
|
|
28
|
+
<div class="container">
|
|
29
|
+
<h1>Check out /speaker</h1>
|
|
30
|
+
<p class="lead">
|
|
31
|
+
Go to <a id="speakerLink">/speaker</a> to simulate calibrating as part of an experiment
|
|
32
|
+
running on a participant's computer. The page will instruct the user on how to use their
|
|
33
|
+
mobile device as a calibration microphone.
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
<script type="text/javascript">
|
|
37
|
+
const speakerLink = '/speaker.html';
|
|
38
|
+
const baseURL = location.href.substring(0, location.href.lastIndexOf('/'));
|
|
39
|
+
document.getElementById('speakerLink').setAttribute('href', baseURL + speakerLink);
|
|
40
|
+
</script>
|
|
41
|
+
<script
|
|
42
|
+
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
|
|
43
|
+
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
|
44
|
+
crossorigin="anonymous"
|
|
45
|
+
></script>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
|
6
|
+
<title>Listener</title>
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
|
|
10
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
11
|
+
|
|
12
|
+
<!-- CSS -->
|
|
13
|
+
<link href="../example/styles.css" rel="stylesheet" typ="text/css" />
|
|
14
|
+
<link
|
|
15
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
|
16
|
+
rel="stylesheet"
|
|
17
|
+
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
|
|
18
|
+
crossorigin="anonymous"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<!--<script src="https://www.unpkg.com/sound-check"> </script>-->
|
|
22
|
+
<script src="../main.js"></script>
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<!--[if lt IE 8]>
|
|
27
|
+
<p class="browserupgrade">
|
|
28
|
+
You are using an <strong>outdated</strong> browser. Please
|
|
29
|
+
<a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.
|
|
30
|
+
</p>
|
|
31
|
+
<![endif]-->
|
|
32
|
+
<div class="container-fluid background">
|
|
33
|
+
<div class="container popup shadow p-3 mb-5 bg-white rounded">
|
|
34
|
+
<h1>Listener Page</h1>
|
|
35
|
+
<p class="lead">
|
|
36
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia maxime sapiente
|
|
37
|
+
repudiandae est, magnam ex sint iure quo porro ullam debitis inventore at temporibus quod
|
|
38
|
+
ducimus nesciunt dolorem laboriosam. Eius!
|
|
39
|
+
</p>
|
|
40
|
+
<div class="row justify-content-center">
|
|
41
|
+
<div class="d-flex col-10 justify-content-center">
|
|
42
|
+
<button id="calibrationBeginButton" type="button" class="btn btn-primary">
|
|
43
|
+
Calibrate Speakers
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="row justify-content-center">
|
|
48
|
+
<div class="d-flex col-10 justify-content-center">
|
|
49
|
+
<button
|
|
50
|
+
id="viewLogButton"
|
|
51
|
+
type="button"
|
|
52
|
+
class="btn btn-primary"
|
|
53
|
+
data-bs-toggle="collapse"
|
|
54
|
+
data-bs-target="#logs"
|
|
55
|
+
aria-expanded="false"
|
|
56
|
+
aria-controls="logs"
|
|
57
|
+
>
|
|
58
|
+
Open Logs
|
|
59
|
+
</button>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="row justify-content-center">
|
|
63
|
+
<div class="d-flex col-10 justify-content-center">
|
|
64
|
+
<div class="collapse" id="logs" style="width: 100%">
|
|
65
|
+
<div
|
|
66
|
+
class="card card-body overflow-auto"
|
|
67
|
+
id="display"
|
|
68
|
+
style="font-size: clamp(16px, 3vw, 22px); height: 40vh"
|
|
69
|
+
></div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<script type="text/javascript">
|
|
76
|
+
const listenerParameters = {
|
|
77
|
+
targetElementId: 'display',
|
|
78
|
+
};
|
|
79
|
+
document.getElementById('calibrationBeginButton').onclick = () => {
|
|
80
|
+
window.listener = new speakerCalibrator.Listener(listenerParameters);
|
|
81
|
+
};
|
|
82
|
+
</script>
|
|
83
|
+
<script
|
|
84
|
+
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
|
|
85
|
+
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
|
86
|
+
crossorigin="anonymous"
|
|
87
|
+
></script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const app = express();
|
|
6
|
+
const port = 3000;
|
|
7
|
+
|
|
8
|
+
app.use('/', express.static(path.join(__dirname, '/../'))); // serve the distribution folder
|
|
9
|
+
|
|
10
|
+
// Middleware to check we have all the params we need
|
|
11
|
+
const checkParams = (req, res, next) => {
|
|
12
|
+
if (!Object.prototype.hasOwnProperty.call(req.query, 'speakerPeerId')) {
|
|
13
|
+
console.log('No peerID given.');
|
|
14
|
+
throw new Error('No peerID given -- unable to connect to peer.');
|
|
15
|
+
}
|
|
16
|
+
next();
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Simple Routing
|
|
20
|
+
app.get('/', (req, res) => {
|
|
21
|
+
res.sendFile(path.join(__dirname, 'index.html'));
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
app.get('/speaker', (req, res) => {
|
|
25
|
+
res.sendFile(path.join(__dirname, 'speaker.html'));
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
app.get('/listener', checkParams, (req, res) => {
|
|
29
|
+
res.sendFile(path.join(__dirname, 'listener.html'));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
app.use((err, req, res) => {
|
|
33
|
+
res.status(err.status || 500);
|
|
34
|
+
res.send({
|
|
35
|
+
error: err.message,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
app.use((req, res) => {
|
|
40
|
+
res.status(404);
|
|
41
|
+
res.send({
|
|
42
|
+
error: '404 not found',
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (!module.parent) {
|
|
47
|
+
app.listen(port);
|
|
48
|
+
console.log(`Express started on port ${port}`);
|
|
49
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
|
6
|
+
<title>Speaker</title>
|
|
7
|
+
<meta name="description" content="" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
<!--CSS-->
|
|
10
|
+
<link href="../example/styles.css" rel="stylesheet" type="text/css" />
|
|
11
|
+
<link
|
|
12
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
|
|
15
|
+
crossorigin="anonymous"
|
|
16
|
+
/>
|
|
17
|
+
<script src="../main.js"></script>
|
|
18
|
+
<link
|
|
19
|
+
rel="icon"
|
|
20
|
+
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔈</text></svg>"
|
|
21
|
+
/>
|
|
22
|
+
<!--<script src="https://www.unpkg.com/sound-check"></script>-->
|
|
23
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"
|
|
24
|
+
integrity="sha256-ErZ09KkZnzjpqcane4SCyyHsKAXMvID9/xwbl/Aq1pc=" crossorigin="anonymous"></script> -->
|
|
25
|
+
<script src="../example/speakerUI.js"></script>
|
|
26
|
+
</head>
|
|
27
|
+
|
|
28
|
+
<body>
|
|
29
|
+
<div class="container-fluid background">
|
|
30
|
+
<div class="container bg-light popup shadow p-3 mb-5 rounded">
|
|
31
|
+
<div class="row">
|
|
32
|
+
<h1>Speaker Page [Admin]</h1>
|
|
33
|
+
<p class="lead">
|
|
34
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia maxime sapiente
|
|
35
|
+
repudiandae est, magnam ex sint iure quo porro ullam debitis inventore at temporibus
|
|
36
|
+
quod ducimus nesciunt dolorem laboriosam. Eius!
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="row justify-content-around">
|
|
40
|
+
<div class="col-lg-3 options-panel shadow p-3 mb-5 bg-white rounded">
|
|
41
|
+
<h3>New Capture</h3>
|
|
42
|
+
<p class="lead">Run a new calibration from end-to-end</p>
|
|
43
|
+
<div class="row">
|
|
44
|
+
<div class="form-check form-switch">
|
|
45
|
+
<input class="form-check-input" type="checkbox" id="flexSwitchCheckVolume" />
|
|
46
|
+
<label class="form-check-label" for="flexSwitchCheckVolume">Volume</label>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="row">
|
|
50
|
+
<div class="form-check form-switch">
|
|
51
|
+
<input class="form-check-input" type="checkbox" id="flexSwitchCheckIR" checked />
|
|
52
|
+
<label class="form-check-label" for="flexSwitchCheckIR">Impulse Response</label>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="row">
|
|
56
|
+
<div class="form-check form-switch">
|
|
57
|
+
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDownload" />
|
|
58
|
+
<label class="form-check-label" for="flexSwitchCheckDownload">Download Data</label>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="row">
|
|
62
|
+
<input type="number" id="mlsOrder" class="form-control" value="18" />
|
|
63
|
+
<label class="form-label" for="mlsOrder">Order of MLS</label>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="row">
|
|
66
|
+
<input type="number" id="numCapturesInput" class="form-control" value="3" />
|
|
67
|
+
<label class="form-label" for="numCapturesInput">Number of Captures</label>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="row">
|
|
70
|
+
<input type="number" id="numMLSPerCaptureInput" class="form-control" value="3" />
|
|
71
|
+
<label class="form-label" for="numMLSPerCaptureInput"
|
|
72
|
+
>Number of MLS burts per capture</label
|
|
73
|
+
>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="row">
|
|
76
|
+
<button id="calibrationBeginButton" type="button" class="btn btn-primary">
|
|
77
|
+
Calibrate
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="col-lg-3 shadow p-3 mb-5 bg-white rounded">
|
|
82
|
+
<h3>Previous Captures</h3>
|
|
83
|
+
<p class="lead">Upload a specific portion of the calibration to test it</p>
|
|
84
|
+
<div class="mb-3">
|
|
85
|
+
<label for="previous-capture-csv" class="form-label">Recorded MLS</label>
|
|
86
|
+
<input class="form-control" type="file" id="previous-capture-csv" />
|
|
87
|
+
</div>
|
|
88
|
+
<div class="mb-3">
|
|
89
|
+
<label for="iir-csv" class="form-label">Inverted Impulse Response</label>
|
|
90
|
+
<input class="form-control" type="file" id="iir-csv" />
|
|
91
|
+
</div>
|
|
92
|
+
<div class="mb-3">
|
|
93
|
+
<div class="form-check form-switch">
|
|
94
|
+
<input class="form-check-input" type="checkbox" id="flexSwitchPlayAndRecord" />
|
|
95
|
+
<label class="form-check-label" for="flexSwitchPlayAndRecord">Play & Record</label>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="col-lg-3 shadow p-3 mb-5 bg-white rounded">
|
|
100
|
+
<h3>WAV file test</h3>
|
|
101
|
+
<p class="lead">Upload a WAV file to play it</p>
|
|
102
|
+
<div class="mb-3">
|
|
103
|
+
<label for="wav-file" class="form-label">WAV File</label>
|
|
104
|
+
<input class="form-control" type="file" id="wav-file" />
|
|
105
|
+
</div>
|
|
106
|
+
<audio id="sound" controls></audio>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="row justify-content-around">
|
|
110
|
+
<div class="col-lg-3 shadow p-3 mb-5 bg-white rounded">
|
|
111
|
+
<h3>Output</h3>
|
|
112
|
+
<div class="row justify-content-center">
|
|
113
|
+
<div id="display" class="border"></div>
|
|
114
|
+
<span id="updates"></span>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<script
|
|
121
|
+
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
|
|
122
|
+
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
|
123
|
+
crossorigin="anonymous"
|
|
124
|
+
></script>
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|