speaker-calibration 2.2.163 → 2.2.165
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/example/NoSleep.min.js +2 -0
- package/dist/example/i18n.js +1913 -1425
- package/dist/example/listener.html +19 -2
- package/dist/example/listener.js +20 -3
- package/dist/example/styles.css +5 -2
- package/dist/main.js +3 -3
- package/package.json +1 -1
- package/src/peer-connection/speaker.js +0 -1
- package/src/tasks/combination/combination.js +12 -21
package/package.json
CHANGED
|
@@ -753,17 +753,20 @@ class Combination extends AudioCalibrator {
|
|
|
753
753
|
* .
|
|
754
754
|
* Created an S Curver Buffer to taper the signal onset
|
|
755
755
|
*
|
|
756
|
-
* @param {*}
|
|
757
|
-
* @param {*} phase
|
|
756
|
+
* @param {*} onSetBool
|
|
758
757
|
* @returns
|
|
759
758
|
* @example
|
|
760
759
|
*/
|
|
761
|
-
|
|
762
|
-
const curve = new Float32Array(
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
760
|
+
createSCurveBuffer = (onSetBool = true) => {
|
|
761
|
+
const curve = new Float32Array(this.TAPER_SECS * this.sourceSamplingRate + 1);
|
|
762
|
+
const frequency = 1 / (4 * this.TAPER_SECS);
|
|
763
|
+
let j = 0;
|
|
764
|
+
for (let i = 0; i < this.TAPER_SECS * this.sourceSamplingRate + 1; i += 1) {
|
|
765
|
+
const phase = 2 * Math.PI * frequency * j;
|
|
766
|
+
const onsetTaper = Math.pow(Math.sin(phase), 2);
|
|
767
|
+
const offsetTaper = Math.pow(Math.cos(phase), 2);
|
|
768
|
+
curve[i] = onSetBool ? onsetTaper : offsetTaper;
|
|
769
|
+
j += 1 / this.sourceSamplingRate;
|
|
767
770
|
}
|
|
768
771
|
return curve;
|
|
769
772
|
};
|
|
@@ -2095,19 +2098,7 @@ class Combination extends AudioCalibrator {
|
|
|
2095
2098
|
}
|
|
2096
2099
|
};
|
|
2097
2100
|
|
|
2098
|
-
|
|
2099
|
-
const curve = new Float32Array(this.TAPER_SECS * this.sourceSamplingRate + 1);
|
|
2100
|
-
const frequency = 1 / (4 * this.TAPER_SECS);
|
|
2101
|
-
let j = 0;
|
|
2102
|
-
for (let i = 0; i < this.TAPER_SECS * this.sourceSamplingRate + 1; i += 1) {
|
|
2103
|
-
const phase = 2 * Math.PI * frequency * j;
|
|
2104
|
-
const onsetTaper = Math.pow(Math.sin(phase), 2);
|
|
2105
|
-
const offsetTaper = Math.pow(Math.cos(phase), 2);
|
|
2106
|
-
curve[i] = onSetBool ? onsetTaper : offsetTaper;
|
|
2107
|
-
j += 1 / this.sourceSamplingRate;
|
|
2108
|
-
}
|
|
2109
|
-
return curve;
|
|
2110
|
-
};
|
|
2101
|
+
|
|
2111
2102
|
|
|
2112
2103
|
#getTruncatedSignal = (left = 3.5, right = 4.5) => {
|
|
2113
2104
|
const start = Math.floor(left * this.sourceSamplingRate);
|