audiomotion-analyzer 4.5.1 → 4.5.2
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/index.js +3 -3
- package/package.json +1 -1
- package/src/audioMotion-analyzer.js +3 -3
package/dist/index.js
CHANGED
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
* audioMotion-analyzer
|
|
22
22
|
* High-resolution real-time graphic audio spectrum analyzer JS module
|
|
23
23
|
*
|
|
24
|
-
* @version 4.5.
|
|
24
|
+
* @version 4.5.2
|
|
25
25
|
* @author Henrique Avila Vianna <hvianna@gmail.com> <https://henriquevianna.com>
|
|
26
26
|
* @license AGPL-3.0-or-later
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
const VERSION = '4.5.
|
|
29
|
+
const VERSION = '4.5.2';
|
|
30
30
|
|
|
31
31
|
// internal constants
|
|
32
32
|
const PI = Math.PI,
|
|
@@ -2114,7 +2114,7 @@
|
|
|
2114
2114
|
if (_fadePeaks && !showPeakLine) {
|
|
2115
2115
|
const initialAlpha = !isAlpha || isOutline && _lineWidth > 0 ? 1 : isAlpha ? bar.peak[channel] : fillAlpha;
|
|
2116
2116
|
bar.alpha[channel] = initialAlpha * (1 + bar.hold[channel] / fadeFrames); // hold is negative, so this is <= 1
|
|
2117
|
-
} else bar.peak[channel] += bar.hold[channel] * gravity / fpsSquared / nominalMaxHeight;
|
|
2117
|
+
} else bar.peak[channel] += bar.hold[channel] * gravity / fpsSquared / Math.abs(nominalMaxHeight);
|
|
2118
2118
|
// make sure the peak value is reset when using fadePeaks
|
|
2119
2119
|
if (bar.alpha[channel] <= 0) bar.peak[channel] = 0;
|
|
2120
2120
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audiomotion-analyzer",
|
|
3
3
|
"description": "High-resolution real-time graphic audio spectrum analyzer JavaScript module with no dependencies.",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.2",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./src/audioMotion-analyzer.js",
|
|
7
7
|
"types": "./src/index.d.ts",
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* audioMotion-analyzer
|
|
3
3
|
* High-resolution real-time graphic audio spectrum analyzer JS module
|
|
4
4
|
*
|
|
5
|
-
* @version 4.5.
|
|
5
|
+
* @version 4.5.2
|
|
6
6
|
* @author Henrique Avila Vianna <hvianna@gmail.com> <https://henriquevianna.com>
|
|
7
7
|
* @license AGPL-3.0-or-later
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const VERSION = '4.5.
|
|
10
|
+
const VERSION = '4.5.2';
|
|
11
11
|
|
|
12
12
|
// internal constants
|
|
13
13
|
const PI = Math.PI,
|
|
@@ -2197,7 +2197,7 @@ class AudioMotionAnalyzer {
|
|
|
2197
2197
|
bar.alpha[ channel ] = initialAlpha * ( 1 + bar.hold[ channel ] / fadeFrames ); // hold is negative, so this is <= 1
|
|
2198
2198
|
}
|
|
2199
2199
|
else
|
|
2200
|
-
bar.peak[ channel ] += bar.hold[ channel ] * gravity / fpsSquared / nominalMaxHeight;
|
|
2200
|
+
bar.peak[ channel ] += bar.hold[ channel ] * gravity / fpsSquared / Math.abs( nominalMaxHeight );
|
|
2201
2201
|
// make sure the peak value is reset when using fadePeaks
|
|
2202
2202
|
if ( bar.alpha[ channel ] <= 0 )
|
|
2203
2203
|
bar.peak[ channel ] = 0;
|