nodejs-audio-visualizer 2.0.0 → 2.1.1
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/README.md +2 -1
- package/dist/bpmEncoder.d.ts +10 -0
- package/dist/bpmEncoder.js +76 -0
- package/dist/bpmEncoder.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +31 -15
- package/dist/config.js.map +1 -1
- package/dist/image.d.ts +28 -3
- package/dist/image.js +80 -21
- package/dist/image.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bpmEncoder.ts +71 -0
- package/src/config.ts +39 -13
- package/src/image.ts +153 -30
- package/src/index.ts +21 -11
- package/src/tests/config.test.ts +60 -0
- package/src/tests/image.test.ts +91 -22
- package/src/tests/index.test.ts +2 -2
- package/src/tests/snapshots/frameSnapshotSpectrumDown.json +1 -1
- package/src/tests/snapshots/frameSnapshotSpectrumUp.json +1 -1
- package/src/tests/snapshots/frameSnapshotSpectrumUpOpacity50.json +1 -0
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ const config = {
|
|
|
21
21
|
x: 'center', // Available values: 'left', 'center', right'. Also you can use absolute number values. For example, value 300 for 300 pixels x.
|
|
22
22
|
y: 'bottom', // Available values: 'top', 'middle', bottom'. Also you can use absolute number values. For example, value 300 for 300 pixels y.
|
|
23
23
|
rotation: 'up', // Available values: 'up', 'down'. Default value: 'down'.
|
|
24
|
-
color: '#cccc99' // Default value: inverted color of background image
|
|
24
|
+
color: '#cccc99', // Default value: inverted color of background image
|
|
25
|
+
opacity: '80%' // Default value: '100%'.
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
tweaks: { // Optional
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBpmEncoder = function (imgData) {
|
|
4
|
+
var width = imgData.width;
|
|
5
|
+
var height = imgData.height;
|
|
6
|
+
var extraBytes = width % 4;
|
|
7
|
+
var rgbSize = height * (3 * width + extraBytes);
|
|
8
|
+
var headerInfoSize = 40;
|
|
9
|
+
/******************header***********************/
|
|
10
|
+
var flag = 'BM';
|
|
11
|
+
var reserved = 0;
|
|
12
|
+
var offset = 54;
|
|
13
|
+
var fileSize = rgbSize + offset;
|
|
14
|
+
var planes = 1;
|
|
15
|
+
var bitPP = 24;
|
|
16
|
+
var compress = 0;
|
|
17
|
+
var hr = 0;
|
|
18
|
+
var vr = 0;
|
|
19
|
+
var colors = 0;
|
|
20
|
+
var importantColors = 0;
|
|
21
|
+
return function (buffer) {
|
|
22
|
+
var tempBuffer = Buffer.alloc(offset + rgbSize);
|
|
23
|
+
var pos = 0;
|
|
24
|
+
tempBuffer.write(flag, pos, 2);
|
|
25
|
+
pos += 2;
|
|
26
|
+
tempBuffer.writeUInt32LE(fileSize, pos);
|
|
27
|
+
pos += 4;
|
|
28
|
+
tempBuffer.writeUInt32LE(reserved, pos);
|
|
29
|
+
pos += 4;
|
|
30
|
+
tempBuffer.writeUInt32LE(offset, pos);
|
|
31
|
+
pos += 4;
|
|
32
|
+
tempBuffer.writeUInt32LE(headerInfoSize, pos);
|
|
33
|
+
pos += 4;
|
|
34
|
+
tempBuffer.writeUInt32LE(width, pos);
|
|
35
|
+
pos += 4;
|
|
36
|
+
tempBuffer.writeInt32LE(-height, pos);
|
|
37
|
+
pos += 4;
|
|
38
|
+
tempBuffer.writeUInt16LE(planes, pos);
|
|
39
|
+
pos += 2;
|
|
40
|
+
tempBuffer.writeUInt16LE(bitPP, pos);
|
|
41
|
+
pos += 2;
|
|
42
|
+
tempBuffer.writeUInt32LE(compress, pos);
|
|
43
|
+
pos += 4;
|
|
44
|
+
tempBuffer.writeUInt32LE(rgbSize, pos);
|
|
45
|
+
pos += 4;
|
|
46
|
+
tempBuffer.writeUInt32LE(hr, pos);
|
|
47
|
+
pos += 4;
|
|
48
|
+
tempBuffer.writeUInt32LE(vr, pos);
|
|
49
|
+
pos += 4;
|
|
50
|
+
tempBuffer.writeUInt32LE(colors, pos);
|
|
51
|
+
pos += 4;
|
|
52
|
+
tempBuffer.writeUInt32LE(importantColors, pos);
|
|
53
|
+
pos += 4;
|
|
54
|
+
var i = 0;
|
|
55
|
+
var rowBytes = 3 * width + extraBytes;
|
|
56
|
+
for (var y = 0; y < height; y++) {
|
|
57
|
+
for (var x = 0; x < width; x++) {
|
|
58
|
+
var p = pos + y * rowBytes + x * 3;
|
|
59
|
+
i++; // a
|
|
60
|
+
tempBuffer[p] = buffer[i++]; // b
|
|
61
|
+
tempBuffer[p + 1] = buffer[i++]; // g
|
|
62
|
+
tempBuffer[p + 2] = buffer[i++]; // r
|
|
63
|
+
}
|
|
64
|
+
if (extraBytes > 0) {
|
|
65
|
+
var fillOffset = pos + y * rowBytes + width * 3;
|
|
66
|
+
tempBuffer.fill(0, fillOffset, fillOffset + extraBytes);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
shiftPos: pos,
|
|
71
|
+
rowBytes: rowBytes,
|
|
72
|
+
data: tempBuffer
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=bpmEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bpmEncoder.js","sourceRoot":"","sources":["../src/bpmEncoder.ts"],"names":[],"mappings":";;AAMa,QAAA,gBAAgB,GAAG,UAAC,OAA2C;IAC1E,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAM,UAAU,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7B,IAAM,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC;IAClD,IAAM,cAAc,GAAG,EAAE,CAAC;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C,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;gBACrC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;aACtC;YACD,IAAI,UAAU,GAAG,CAAC,EAAE;gBAClB,IAAM,UAAU,GAAG,GAAG,GAAG,CAAC,GAAG,QAAQ,GAAG,KAAK,GAAG,CAAC,CAAC;gBAClD,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;aACzD;SACF;QAED,OAAO;YACL,QAAQ,EAAE,GAAG;YACb,QAAQ,UAAA;YACR,IAAI,EAAE,UAAU;SACjB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export declare const defaults: {
|
|
|
6
6
|
spectrumX: string;
|
|
7
7
|
spectrumY: string;
|
|
8
8
|
spectrumRotation: string;
|
|
9
|
+
spectrumBusesCount: number;
|
|
10
|
+
spectrumBusMargin: number;
|
|
11
|
+
spectrumOpacity: string;
|
|
9
12
|
};
|
|
10
13
|
export declare const rotationAliasValues: readonly ["up", "down"];
|
|
11
14
|
export declare const checkIsPercentValue: (value: string) => boolean;
|
|
@@ -13,6 +16,8 @@ export declare const getAudioFilePath: (config: Config) => string;
|
|
|
13
16
|
export declare const getBackgroundImagePath: (config: Config) => string;
|
|
14
17
|
export declare const getOutVideoPath: (config: Config) => string;
|
|
15
18
|
export declare const getFPS: (config: Config) => number;
|
|
19
|
+
export declare const getSpectrumBusesCount: () => number;
|
|
20
|
+
export declare const getSpectrumBusMargin: () => number;
|
|
16
21
|
export declare const getSpectrumWidthAbsolute: (config: Config, backgroundImageWidth: number) => number;
|
|
17
22
|
export declare const getSpectrumHeightAbsolute: (config: Config, backgroundImageHeight: number) => number;
|
|
18
23
|
export declare const getSpectrumXAbsolute: (config: Config, spectrumWidth: number, backgroundImageWidth: number) => number;
|
|
@@ -20,6 +25,8 @@ export declare const getSpectrumYAbsolute: (config: Config, spectrumHeight: numb
|
|
|
20
25
|
export declare const checkIsValidRotationAlias: (aliasName: string) => boolean;
|
|
21
26
|
export declare const getSpectrumRotation: (config: Config) => "up" | "down";
|
|
22
27
|
export declare const getSpectrumColor: (config: Config) => string | import("./image").Color | undefined;
|
|
28
|
+
export declare const getSpectrumOpacity: (config: Config) => string;
|
|
29
|
+
export declare const getSpectrumOpacityParsed: (config: Config) => number;
|
|
23
30
|
export declare const getFfmpeg_cfr: (config: Config) => string | undefined;
|
|
24
31
|
export declare const getFfmpeg_preset: (config: Config) => string | undefined;
|
|
25
32
|
export declare const getFrame_processing_delay: (config: Config) => number | undefined;
|
package/dist/config.js
CHANGED
|
@@ -10,7 +10,10 @@ exports.defaults = {
|
|
|
10
10
|
spectrumHeight: '10%',
|
|
11
11
|
spectrumX: 'center',
|
|
12
12
|
spectrumY: 'top',
|
|
13
|
-
spectrumRotation: 'down'
|
|
13
|
+
spectrumRotation: 'down',
|
|
14
|
+
spectrumBusesCount: 64,
|
|
15
|
+
spectrumBusMargin: 4,
|
|
16
|
+
spectrumOpacity: '100%',
|
|
14
17
|
};
|
|
15
18
|
var postitionAliases = [
|
|
16
19
|
{ name: 'left', value: 0 },
|
|
@@ -36,17 +39,19 @@ exports.getOutVideoPath = function (config) {
|
|
|
36
39
|
exports.getFPS = function (config) {
|
|
37
40
|
return config.outVideo.fps || exports.defaults.fps;
|
|
38
41
|
};
|
|
42
|
+
exports.getSpectrumBusesCount = function () { return exports.defaults.spectrumBusesCount; };
|
|
43
|
+
exports.getSpectrumBusMargin = function () { return exports.defaults.spectrumBusMargin; };
|
|
39
44
|
var getSpectrumWidth = function (config) {
|
|
40
45
|
return (config.outVideo.spectrum && config.outVideo.spectrum.width) ||
|
|
41
46
|
exports.defaults.spectrumWidth;
|
|
42
47
|
};
|
|
43
|
-
var getSpectrumSizeAbsolute = function (spectrumSize, backgroundImageSize) {
|
|
48
|
+
var getSpectrumSizeAbsolute = function (spectrumSize, backgroundImageSize, fieldName) {
|
|
44
49
|
if (typeof spectrumSize === 'number') {
|
|
45
50
|
return spectrumSize;
|
|
46
51
|
}
|
|
47
52
|
var isPercentValue = exports.checkIsPercentValue(spectrumSize);
|
|
48
53
|
if (!isPercentValue) {
|
|
49
|
-
throw new Error();
|
|
54
|
+
throw new Error(getSpectrumSizeValueErrorMessage(fieldName, spectrumSize));
|
|
50
55
|
}
|
|
51
56
|
var percentValue = parseInt(spectrumSize) / 100;
|
|
52
57
|
return backgroundImageSize * percentValue;
|
|
@@ -56,12 +61,12 @@ var getSpectrumSizeValueErrorMessage = function (fieldName, value) {
|
|
|
56
61
|
};
|
|
57
62
|
exports.getSpectrumWidthAbsolute = function (config, backgroundImageWidth) {
|
|
58
63
|
var spectrumWidth = getSpectrumWidth(config);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
throw new Error(getSpectrumSizeValueErrorMessage('width', spectrumWidth));
|
|
64
|
+
var spectrumWidthAbsolute = getSpectrumSizeAbsolute(spectrumWidth, backgroundImageWidth, 'width');
|
|
65
|
+
var spectrumWidthWithoutMargin = Math.trunc(spectrumWidthAbsolute / exports.defaults.spectrumBusesCount) - exports.defaults.spectrumBusMargin / 2;
|
|
66
|
+
if (spectrumWidthWithoutMargin <= 0) {
|
|
67
|
+
throw new Error("Spectrum width '" + spectrumWidth + "' is too small.");
|
|
64
68
|
}
|
|
69
|
+
return spectrumWidthAbsolute;
|
|
65
70
|
};
|
|
66
71
|
var getSpectrumHeight = function (config) {
|
|
67
72
|
return (config.outVideo.spectrum && config.outVideo.spectrum.height) ||
|
|
@@ -69,12 +74,7 @@ var getSpectrumHeight = function (config) {
|
|
|
69
74
|
};
|
|
70
75
|
exports.getSpectrumHeightAbsolute = function (config, backgroundImageHeight) {
|
|
71
76
|
var spectrumHeight = getSpectrumHeight(config);
|
|
72
|
-
|
|
73
|
-
return getSpectrumSizeAbsolute(spectrumHeight, backgroundImageHeight);
|
|
74
|
-
}
|
|
75
|
-
catch (_a) {
|
|
76
|
-
throw new Error(getSpectrumSizeValueErrorMessage('height', spectrumHeight));
|
|
77
|
-
}
|
|
77
|
+
return getSpectrumSizeAbsolute(spectrumHeight, backgroundImageHeight, 'height');
|
|
78
78
|
};
|
|
79
79
|
var getSpectrumX = function (config) {
|
|
80
80
|
return parseNumberIfPossible((config.outVideo.spectrum && config.outVideo.spectrum.x) ||
|
|
@@ -155,7 +155,23 @@ exports.getSpectrumRotation = function (config) {
|
|
|
155
155
|
return rotationValue;
|
|
156
156
|
};
|
|
157
157
|
exports.getSpectrumColor = function (config) {
|
|
158
|
-
return
|
|
158
|
+
return config.outVideo.spectrum && config.outVideo.spectrum.color;
|
|
159
|
+
};
|
|
160
|
+
exports.getSpectrumOpacity = function (config) {
|
|
161
|
+
return (config.outVideo.spectrum && config.outVideo.spectrum.opacity) ||
|
|
162
|
+
exports.defaults.spectrumOpacity;
|
|
163
|
+
};
|
|
164
|
+
exports.getSpectrumOpacityParsed = function (config) {
|
|
165
|
+
var spectrumOpacity = exports.getSpectrumOpacity(config);
|
|
166
|
+
if (!exports.checkIsPercentValue(spectrumOpacity)) {
|
|
167
|
+
throw new Error("Invalid spectrum opacity value: '" + spectrumOpacity + "'. Use string percent value, for example '80%'.");
|
|
168
|
+
}
|
|
169
|
+
var percentValue = parseInt(spectrumOpacity);
|
|
170
|
+
if ((percentValue < 0) ||
|
|
171
|
+
(percentValue > 100)) {
|
|
172
|
+
throw new Error("Invalid spectrum opacity value: '" + spectrumOpacity + "'. Percent values must be in range from '0%' to '100%'.");
|
|
173
|
+
}
|
|
174
|
+
return percentValue / 100;
|
|
159
175
|
};
|
|
160
176
|
exports.getFfmpeg_cfr = function (config) {
|
|
161
177
|
return config.tweaks && config.tweaks.ffmpeg_cfr;
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;AAAA,8CAAwB;AAGX,QAAA,QAAQ,GAAG;IACtB,GAAG,EAAE,EAAE;IACP,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,KAAK;IAChB,gBAAgB,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;AAAA,8CAAwB;AAGX,QAAA,QAAQ,GAAG;IACtB,GAAG,EAAE,EAAE;IACP,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,KAAK;IAChB,gBAAgB,EAAE,MAAM;IACxB,kBAAkB,EAAE,EAAE;IACtB,iBAAiB,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM;CACxB,CAAC;AASF,IAAM,gBAAgB,GAAoB;IACxC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE;IAC1B,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;IAC9B,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE;IAC3B,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;IACzB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;IAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;CAC7B,CAAC;AAEW,QAAA,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,CAAU,CAAC;AAE9C,QAAA,mBAAmB,GAAG,UAAC,KAAa;IAC/C,OAAA,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AAA1B,CAA0B,CAAA;AAEf,QAAA,gBAAgB,GAAG,UAAC,MAAc;IAC7C,OAA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,OAAO,YAAY,GAAG,GAAG,CAAC;AAC5B,CAAC,CAAC;AAEW,QAAA,aAAa,GAAG,UAAC,MAAc;IAC1C,OAAA,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU;AAAzC,CAAyC,CAAC;AAE/B,QAAA,gBAAgB,GAAG,UAAC,MAAc;IAC7C,OAAA,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa;AAA5C,CAA4C,CAAC;AAElC,QAAA,yBAAyB,GAAG,UAAC,MAAc;IACtD,OAAA,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,sBAAsB;AAArD,CAAqD,CAAC"}
|
package/dist/image.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { RotationAliasName } from './index';
|
|
2
3
|
import { BmpDecoder } from 'bmp-js';
|
|
4
|
+
import { EncodedBmp } from './bpmEncoder';
|
|
3
5
|
export interface Color {
|
|
4
6
|
red: number;
|
|
5
7
|
green: number;
|
|
@@ -13,11 +15,34 @@ interface Size {
|
|
|
13
15
|
width: number;
|
|
14
16
|
height: number;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
interface MixColorProps {
|
|
19
|
+
color: Color;
|
|
20
|
+
colorOpacity: number;
|
|
21
|
+
backgroundColor: Color;
|
|
22
|
+
}
|
|
23
|
+
export declare const mixValues: (value1: number, value1Opacity: number, value2: number) => number;
|
|
24
|
+
export declare const mixColors: ({ color, colorOpacity, backgroundColor, }: MixColorProps) => Color;
|
|
25
|
+
interface DrawRectPorps {
|
|
26
|
+
imageDstBuffer: EncodedBmp;
|
|
27
|
+
position: Position;
|
|
28
|
+
size: Size;
|
|
29
|
+
color: Color;
|
|
30
|
+
opacity: number;
|
|
31
|
+
}
|
|
32
|
+
export declare const drawRect: ({ imageDstBuffer, position, size, color, opacity, }: DrawRectPorps) => void;
|
|
33
|
+
interface CreateVisualizerFrameProps {
|
|
34
|
+
backgroundImageBuffer: EncodedBmp;
|
|
35
|
+
spectrum: number[];
|
|
36
|
+
size: Size;
|
|
37
|
+
position: Position;
|
|
38
|
+
rotation: RotationAliasName;
|
|
39
|
+
margin: number;
|
|
40
|
+
color: Color | string;
|
|
41
|
+
opacity: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const createVisualizerFrame: ({ backgroundImageBuffer, spectrum, size, position, rotation, margin, color, opacity, }: CreateVisualizerFrameProps) => EncodedBmp;
|
|
18
44
|
export declare const convertToBmp: (filePath: string) => Promise<Buffer>;
|
|
19
45
|
export declare const parseImage: (buffer: Buffer) => BmpDecoder;
|
|
20
|
-
export declare const createImageBuffer: (image: BmpDecoder) => Buffer;
|
|
21
46
|
export declare const getImageColor: (image: BmpDecoder) => Color;
|
|
22
47
|
export declare const invertColor: (color: Color) => {
|
|
23
48
|
red: number;
|
package/dist/image.js
CHANGED
|
@@ -41,22 +41,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var bmp_js_1 = require("bmp-js");
|
|
43
43
|
var jimp_1 = __importDefault(require("jimp"));
|
|
44
|
-
exports.
|
|
44
|
+
exports.mixValues = function (value1, value1Opacity, value2) {
|
|
45
|
+
return Math.round(value2 * (1 - value1Opacity) + value1 * value1Opacity);
|
|
46
|
+
};
|
|
47
|
+
exports.mixColors = function (_a) {
|
|
48
|
+
var color = _a.color, colorOpacity = _a.colorOpacity, backgroundColor = _a.backgroundColor;
|
|
49
|
+
return {
|
|
50
|
+
red: exports.mixValues(color.red, colorOpacity, backgroundColor.red),
|
|
51
|
+
green: exports.mixValues(color.green, colorOpacity, backgroundColor.green),
|
|
52
|
+
blue: exports.mixValues(color.blue, colorOpacity, backgroundColor.blue),
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var getRectPixelColor = function (params) {
|
|
56
|
+
var imageDstBuffer = params.imageDstBuffer, pixelIndex = params.pixelIndex, color = params.color, opacity = params.opacity;
|
|
57
|
+
if (opacity === 1) {
|
|
58
|
+
return color;
|
|
59
|
+
}
|
|
60
|
+
var backgroundPixelColor = {
|
|
61
|
+
blue: imageDstBuffer.data[pixelIndex],
|
|
62
|
+
green: imageDstBuffer.data[pixelIndex + 1],
|
|
63
|
+
red: imageDstBuffer.data[pixelIndex + 2],
|
|
64
|
+
};
|
|
65
|
+
var resultColor = exports.mixColors({
|
|
66
|
+
color: color,
|
|
67
|
+
colorOpacity: opacity,
|
|
68
|
+
backgroundColor: backgroundPixelColor,
|
|
69
|
+
});
|
|
70
|
+
return resultColor;
|
|
71
|
+
};
|
|
72
|
+
exports.drawRect = function (_a) {
|
|
73
|
+
var imageDstBuffer = _a.imageDstBuffer, position = _a.position, size = _a.size, color = _a.color, opacity = _a.opacity;
|
|
45
74
|
for (var currY = position.y; currY < position.y + size.height; currY++) {
|
|
46
75
|
for (var currX = position.x; currX < position.x + size.width; currX++) {
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
var pixelIndex = imageDstBuffer.shiftPos + currY * imageDstBuffer.rowBytes + currX * 3;
|
|
77
|
+
var pixelColor = getRectPixelColor({
|
|
78
|
+
imageDstBuffer: imageDstBuffer,
|
|
79
|
+
pixelIndex: pixelIndex,
|
|
80
|
+
color: color,
|
|
81
|
+
opacity: opacity,
|
|
82
|
+
});
|
|
83
|
+
imageDstBuffer.data[pixelIndex] = pixelColor.blue;
|
|
84
|
+
imageDstBuffer.data[pixelIndex + 1] = pixelColor.green;
|
|
85
|
+
imageDstBuffer.data[pixelIndex + 2] = pixelColor.red;
|
|
51
86
|
}
|
|
52
87
|
}
|
|
53
88
|
};
|
|
54
|
-
var drawSpectrum = function (
|
|
89
|
+
var drawSpectrum = function (_a) {
|
|
90
|
+
var imageDstBuffer = _a.imageDstBuffer, spectrum = _a.spectrum, size = _a.size, position = _a.position, rotation = _a.rotation, margin = _a.margin, color = _a.color, opacity = _a.opacity;
|
|
55
91
|
var busWidth = Math.trunc(size.width / spectrum.length);
|
|
56
92
|
var left = Math.trunc(position.x);
|
|
57
93
|
var top = Math.trunc(position.y);
|
|
58
94
|
var height = Math.trunc(size.height);
|
|
59
|
-
var margin = 4;
|
|
60
95
|
for (var spectrumX = 0; spectrumX < spectrum.length; spectrumX++) {
|
|
61
96
|
var spectrumValue = spectrum[spectrumX];
|
|
62
97
|
if ((spectrumValue > 1) || (spectrumValue < 0)) {
|
|
@@ -65,36 +100,60 @@ var drawSpectrum = function (imageDstBuffer, spectrum, size, position, rotation,
|
|
|
65
100
|
var rectX = left + busWidth * spectrumX;
|
|
66
101
|
var rectHeight = Math.trunc(height * spectrumValue);
|
|
67
102
|
var rectY = (rotation === 'up') ? top + height - rectHeight : top;
|
|
68
|
-
exports.drawRect(
|
|
103
|
+
exports.drawRect({
|
|
104
|
+
imageDstBuffer: imageDstBuffer,
|
|
105
|
+
position: { x: rectX + margin, y: rectY },
|
|
106
|
+
size: { width: busWidth - margin / 2, height: rectHeight },
|
|
107
|
+
color: color,
|
|
108
|
+
opacity: opacity,
|
|
109
|
+
});
|
|
69
110
|
}
|
|
70
111
|
};
|
|
71
|
-
exports.createVisualizerFrame = function (
|
|
72
|
-
var
|
|
73
|
-
|
|
112
|
+
exports.createVisualizerFrame = function (_a) {
|
|
113
|
+
var backgroundImageBuffer = _a.backgroundImageBuffer, spectrum = _a.spectrum, size = _a.size, position = _a.position, rotation = _a.rotation, margin = _a.margin, color = _a.color, opacity = _a.opacity;
|
|
114
|
+
var imageDstBuffer = Object.assign({}, backgroundImageBuffer);
|
|
115
|
+
imageDstBuffer.data = Buffer.from(backgroundImageBuffer.data);
|
|
74
116
|
var rgbSpectrumColor = (typeof color === 'string') ? hexToRgb(color) : color;
|
|
75
|
-
drawSpectrum(
|
|
76
|
-
|
|
117
|
+
drawSpectrum({
|
|
118
|
+
imageDstBuffer: imageDstBuffer,
|
|
119
|
+
spectrum: spectrum,
|
|
120
|
+
size: size,
|
|
121
|
+
position: position,
|
|
122
|
+
rotation: rotation,
|
|
123
|
+
margin: margin,
|
|
124
|
+
color: rgbSpectrumColor,
|
|
125
|
+
opacity: opacity,
|
|
126
|
+
});
|
|
127
|
+
return imageDstBuffer;
|
|
77
128
|
};
|
|
78
129
|
exports.convertToBmp = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
130
|
return __generator(this, function (_a) {
|
|
80
|
-
return [2 /*return*/, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
-
var image;
|
|
82
|
-
return __generator(this, function (
|
|
83
|
-
switch (
|
|
84
|
-
case 0:
|
|
131
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
132
|
+
var image, _a;
|
|
133
|
+
return __generator(this, function (_b) {
|
|
134
|
+
switch (_b.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
_b.trys.push([0, 2, , 3]);
|
|
137
|
+
return [4 /*yield*/, jimp_1.default.read(filePath)];
|
|
85
138
|
case 1:
|
|
86
|
-
image =
|
|
139
|
+
image = _b.sent();
|
|
87
140
|
image.getBuffer("image/bmp", function (err, value) {
|
|
141
|
+
if (err) {
|
|
142
|
+
reject(err);
|
|
143
|
+
}
|
|
88
144
|
resolve(value);
|
|
89
145
|
});
|
|
90
|
-
return [
|
|
146
|
+
return [3 /*break*/, 3];
|
|
147
|
+
case 2:
|
|
148
|
+
_a = _b.sent();
|
|
149
|
+
throw new Error("Cannot procces image file from path: " + filePath);
|
|
150
|
+
case 3: return [2 /*return*/];
|
|
91
151
|
}
|
|
92
152
|
});
|
|
93
153
|
}); })];
|
|
94
154
|
});
|
|
95
155
|
}); };
|
|
96
156
|
exports.parseImage = function (buffer) { return bmp_js_1.decode(buffer); };
|
|
97
|
-
exports.createImageBuffer = function (image) { return bmp_js_1.encode(image).data; };
|
|
98
157
|
exports.getImageColor = function (image) {
|
|
99
158
|
var blueSum = 0;
|
|
100
159
|
var greenSum = 0;
|
package/dist/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAA4C;AAE5C,8CAAwB;AAwBX,QAAA,SAAS,GAAE,UAAC,MAAc,EAAE,aAAqB,EAAE,MAAc;IAC5E,OAAA,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,GAAG,MAAM,GAAG,aAAa,CAAC;AAAjE,CAAiE,CAAC;AAEvD,QAAA,SAAS,GAAG,UAAC,EAIV;QAHd,gBAAK,EACL,8BAAY,EACZ,oCAAe;IAEf,OAAO;QACL,GAAG,EAAE,iBAAS,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,eAAe,CAAC,GAAG,CAAC;QAC5D,KAAK,EAAE,iBAAS,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,CAAC,KAAK,CAAC;QAClE,IAAI,EAAE,iBAAS,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC,IAAI,CAAC;KAChE,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,iBAAiB,GAAG,UAAC,MAK1B;IAEG,IAAA,sCAAc,EACd,8BAAU,EACV,oBAAK,EACL,wBAAO,CACE;IACX,IAAI,OAAO,KAAK,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,IAAM,oBAAoB,GAAU;QAClC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC;QACrC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAC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AG,UAAC,GAAW;IAC3B,IAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9C,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChD,IAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE/C,OAAO,EAAE,GAAG,KAAA,EAAE,KAAK,OAAA,EAAE,IAAI,MAAA,EAAE,CAAC;AAC9B,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@ var config_1 = require("./config");
|
|
|
51
51
|
var audio_1 = require("./audio");
|
|
52
52
|
var image_1 = require("./image");
|
|
53
53
|
var video_1 = require("./video");
|
|
54
|
+
var bpmEncoder_1 = require("./bpmEncoder");
|
|
54
55
|
exports.PCM_FORMAT = {
|
|
55
56
|
bit: 8,
|
|
56
57
|
sign: 'u',
|
|
@@ -62,7 +63,7 @@ var sleep = function (timeout) {
|
|
|
62
63
|
};
|
|
63
64
|
exports.renderAudioVisualizer = function (config, onProgress, shouldStop) {
|
|
64
65
|
return new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
-
var audioFilePath, backgroundImagePath, outVideoPath, backgroundImageBmpBuffer, backgroundImage, audioReader, audioBuffer, sampleRate, FPS, spectrumWidth, spectrumHeight, spectrumX, spectrumY, spectrumRotation, spectrumColor, ffmpeg_cfr, ffmpeg_preset, frame_processing_delay,
|
|
66
|
+
var audioFilePath, backgroundImagePath, outVideoPath, backgroundImageBmpBuffer, backgroundImage, audioReader, audioBuffer, sampleRate, spectrumBusesCount, spectrumBusMargin, FPS, spectrumWidth, spectrumHeight, spectrumX, spectrumY, spectrumRotation, spectrumColor, spectrumOpacity, ffmpeg_cfr, ffmpeg_preset, frame_processing_delay, audioDuration, framesCount, audioDataStep, ffmpegVideoWriter, bpmEncoder, backgroundImageBuffer, processSpectrum, _loop_1, i, state_1;
|
|
66
67
|
return __generator(this, function (_a) {
|
|
67
68
|
switch (_a.label) {
|
|
68
69
|
case 0:
|
|
@@ -81,6 +82,8 @@ exports.renderAudioVisualizer = function (config, onProgress, shouldStop) {
|
|
|
81
82
|
if (!sampleRate) {
|
|
82
83
|
throw new Error('ffmpeg didn\'t show audio sample rate');
|
|
83
84
|
}
|
|
85
|
+
spectrumBusesCount = config_1.getSpectrumBusesCount();
|
|
86
|
+
spectrumBusMargin = config_1.getSpectrumBusMargin();
|
|
84
87
|
FPS = config_1.getFPS(config);
|
|
85
88
|
spectrumWidth = config_1.getSpectrumWidthAbsolute(config, backgroundImage.width);
|
|
86
89
|
spectrumHeight = config_1.getSpectrumHeightAbsolute(config, backgroundImage.height);
|
|
@@ -89,18 +92,20 @@ exports.renderAudioVisualizer = function (config, onProgress, shouldStop) {
|
|
|
89
92
|
spectrumRotation = config_1.getSpectrumRotation(config);
|
|
90
93
|
spectrumColor = config_1.getSpectrumColor(config) ||
|
|
91
94
|
image_1.invertColor(image_1.getImageColor(backgroundImage));
|
|
95
|
+
spectrumOpacity = config_1.getSpectrumOpacityParsed(config);
|
|
92
96
|
ffmpeg_cfr = config_1.getFfmpeg_cfr(config);
|
|
93
97
|
ffmpeg_preset = config_1.getFfmpeg_preset(config);
|
|
94
98
|
frame_processing_delay = config_1.getFrame_processing_delay(config);
|
|
95
|
-
spectrumBusesCount = 64;
|
|
96
99
|
audioDuration = audioBuffer.length / sampleRate;
|
|
97
100
|
framesCount = Math.trunc(audioDuration * FPS);
|
|
98
101
|
audioDataStep = Math.trunc(audioBuffer.length / framesCount);
|
|
99
102
|
ffmpegVideoWriter = video_1.spawnFfmpegVideoWriter(__assign(__assign(__assign({ audioFilename: audioFilePath, videoFileName: outVideoPath, fps: FPS }, (!!onProgress && { onStderr: video_1.getProgress(video_1.calculateProgress(framesCount + 1, onProgress)) })), (ffmpeg_cfr && { crf: ffmpeg_cfr })), (ffmpeg_preset && { preset: ffmpeg_preset })));
|
|
100
103
|
ffmpegVideoWriter.on('exit', function (code) { return resolve(code); });
|
|
104
|
+
bpmEncoder = bpmEncoder_1.createBpmEncoder({ width: backgroundImage.width, height: backgroundImage.height });
|
|
105
|
+
backgroundImageBuffer = bpmEncoder(backgroundImage.data);
|
|
101
106
|
processSpectrum = audio_1.createSpectrumsProcessor(spectrumBusesCount);
|
|
102
107
|
_loop_1 = function (i) {
|
|
103
|
-
var audioDataParser, spectrum, frameImage,
|
|
108
|
+
var audioDataParser, spectrum, frameImage, isFrameProcessed;
|
|
104
109
|
return __generator(this, function (_a) {
|
|
105
110
|
switch (_a.label) {
|
|
106
111
|
case 0:
|
|
@@ -108,9 +113,17 @@ exports.renderAudioVisualizer = function (config, onProgress, shouldStop) {
|
|
|
108
113
|
return exports.PCM_FORMAT.parseFunction(audioBuffer, i * audioDataStep, i * audioDataStep + audioDataStep);
|
|
109
114
|
};
|
|
110
115
|
spectrum = processSpectrum(i, audioDataParser);
|
|
111
|
-
frameImage = image_1.createVisualizerFrame(
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
frameImage = image_1.createVisualizerFrame({
|
|
117
|
+
backgroundImageBuffer: backgroundImageBuffer,
|
|
118
|
+
spectrum: spectrum,
|
|
119
|
+
size: { width: spectrumWidth, height: spectrumHeight },
|
|
120
|
+
position: { x: spectrumX, y: spectrumY },
|
|
121
|
+
rotation: spectrumRotation,
|
|
122
|
+
margin: spectrumBusMargin,
|
|
123
|
+
color: spectrumColor,
|
|
124
|
+
opacity: spectrumOpacity,
|
|
125
|
+
});
|
|
126
|
+
isFrameProcessed = ffmpegVideoWriter.stdin.write(frameImage.data);
|
|
114
127
|
if (!!isFrameProcessed) return [3 /*break*/, 2];
|
|
115
128
|
return [4 /*yield*/, video_1.waitDrain(ffmpegVideoWriter.stdin)];
|
|
116
129
|
case 1:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAkBkB;AAClB,iCAAqF;AACrF,iCAA6G;AAC7G,iCAA4F;AAC5F,2CAAgD;AAEnC,QAAA,UAAU,GAAG;IACxB,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,GAAG;IACT,aAAa,EAAE,qBAAa;CAC7B,CAAC;AACF,IAAM,aAAa,GAAG,KAAG,kBAAU,CAAC,IAAI,GAAG,kBAAU,CAAC,GAAK,CAAC;AAyC5D,IAAM,KAAK,GAAG,UAAC,OAAe;IAC5B,OAAA,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAA5B,CAA4B,CAAC;AAApD,CAAoD,CAAC;AAE1C,QAAA,qBAAqB,GAAG,UAAC,MAAc,EAAE,UAAsC,EAAE,UAA0B;IACtH,OAAA,IAAI,OAAO,CAAS,UAAO,OAAO;;;;;oBAC1B,aAAa,GAAG,yBAAgB,CAAC,MAAM,CAAC,CAAC;oBACzC,mBAAmB,GAAG,+BAAsB,CAAC,MAAM,CAAC,CAAC;oBACrD,YAAY,GAAG,wBAAe,CAAC,MAAM,CAAC,CAAC;oBAEZ,qBAAM,oBAAY,CAAC,mBAAmB,CAAC,EAAA;;oBAAlE,wBAAwB,GAAG,SAAuC;oBAClE,eAAe,GAAG,kBAAU,CAAC,wBAAwB,CAAC,CAAC;oBACzC,qBAAM,yBAAiB,CAAC,aAAa,EAAE,aAAa,CAAC,EAAA;;oBAAnE,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