speaker-calibration 2.2.242 → 2.2.244
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/dist/main.js +5 -5
- package/package.json +1 -1
- package/src/peer-connection/speaker.js +7 -2
- package/src/server/PythonServerAPI.js +31 -2
- package/src/tasks/audioCalibrator.js +413 -359
- package/src/tasks/audioRecorder.js +351 -323
- package/src/tasks/combination/combination.js +3636 -3365
package/package.json
CHANGED
|
@@ -270,7 +270,9 @@ class Speaker extends AudioPeer {
|
|
|
270
270
|
params.loudspeakerModelName,
|
|
271
271
|
params.phrases,
|
|
272
272
|
params.soundSubtitleId,
|
|
273
|
-
params.calibrateSoundBurstDownsample
|
|
273
|
+
params.calibrateSoundBurstDownsample,
|
|
274
|
+
params.calibrateSoundSimulateMicrophone,
|
|
275
|
+
params.calibrateSoundSimulateLoudspeaker
|
|
274
276
|
);
|
|
275
277
|
speaker.#removeUIElems();
|
|
276
278
|
//remove the call
|
|
@@ -431,6 +433,7 @@ class Speaker extends AudioPeer {
|
|
|
431
433
|
explanation.id = 'skipQRExplanation';
|
|
432
434
|
explanation.style.margin = '0';
|
|
433
435
|
explanation.style.textAlign = 'left';
|
|
436
|
+
explanation.style.lineHeight = '1.5';
|
|
434
437
|
explanation.innerHTML = formatLineBreak(
|
|
435
438
|
this.phrases.RC_skipQR_ExplanationWithoutPreferNot[this.language]
|
|
436
439
|
.replace('xxx', `<b style="user-select: text">${shortURL}</b>`)
|
|
@@ -856,7 +859,9 @@ class Speaker extends AudioPeer {
|
|
|
856
859
|
params.loudspeakerModelName,
|
|
857
860
|
params.phrases,
|
|
858
861
|
params.soundSubtitleId,
|
|
859
|
-
params.calibrateSoundBurstDownsample
|
|
862
|
+
params.calibrateSoundBurstDownsample,
|
|
863
|
+
params.calibrateSoundSimulateMicrophone,
|
|
864
|
+
params.calibrateSoundSimulateLoudspeaker
|
|
860
865
|
);
|
|
861
866
|
clearInterval(permissionCheckInterval);
|
|
862
867
|
window.speaker.#removeUIElems();
|
|
@@ -7,7 +7,7 @@ class PythonServerAPI {
|
|
|
7
7
|
static PYTHON_SERVER_URL = 'https://easyeyes-python-flask-server.herokuapp.com';
|
|
8
8
|
|
|
9
9
|
static TEST_SERVER_URL = 'http://127.0.0.1:5000';
|
|
10
|
-
// static PYTHON_SERVER_URL ='http://127.0.0.1:5000';
|
|
10
|
+
// static PYTHON_SERVER_URL = 'http://127.0.0.1:5000';
|
|
11
11
|
|
|
12
12
|
/** @private */
|
|
13
13
|
MAX_RETRY_COUNT = 3;
|
|
@@ -760,7 +760,7 @@ class PythonServerAPI {
|
|
|
760
760
|
})
|
|
761
761
|
.then(response => {
|
|
762
762
|
res = response;
|
|
763
|
-
console.log(res.data[task]);
|
|
763
|
+
console.log('data', data, 'res', res.data[task]);
|
|
764
764
|
})
|
|
765
765
|
.catch(error => {
|
|
766
766
|
throw error;
|
|
@@ -779,6 +779,35 @@ class PythonServerAPI {
|
|
|
779
779
|
return res.data[task];
|
|
780
780
|
};
|
|
781
781
|
|
|
782
|
+
irConvolution = async ({input_signal, microphone_ir, loudspeaker_ir}) => {
|
|
783
|
+
const task = 'ir-convolution';
|
|
784
|
+
let res = null;
|
|
785
|
+
|
|
786
|
+
const data = JSON.stringify({
|
|
787
|
+
input_signal,
|
|
788
|
+
microphone_ir,
|
|
789
|
+
loudspeaker_ir,
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
await axios({
|
|
793
|
+
method: 'post',
|
|
794
|
+
baseURL: PythonServerAPI.PYTHON_SERVER_URL, //server
|
|
795
|
+
url: `/task/${task}`,
|
|
796
|
+
headers: {
|
|
797
|
+
'Content-Type': 'application/json',
|
|
798
|
+
},
|
|
799
|
+
data,
|
|
800
|
+
})
|
|
801
|
+
.then(response => {
|
|
802
|
+
res = response;
|
|
803
|
+
})
|
|
804
|
+
.catch(error => {
|
|
805
|
+
throw error;
|
|
806
|
+
});
|
|
807
|
+
console.log('res in irConvolution: ', res);
|
|
808
|
+
return res.data[task];
|
|
809
|
+
};
|
|
810
|
+
|
|
782
811
|
allHzPowerCheck = async ({
|
|
783
812
|
payload,
|
|
784
813
|
sampleRate,
|