nodejs-audio-visualizer 4.2.4 → 4.2.6

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.
@@ -1,222 +1,222 @@
1
- import { expect } from 'chai';
2
- import path from 'path';
3
- import {
4
- drawRect,
5
- Color,
6
- createSpectrumVisualizerFrameGenerator,
7
- createPolarVisualizerFrameGenerator,
8
- parseImage,
9
- convertToBmp,
10
- mixValues,
11
- mixColors,
12
- } from '../image';
13
- import { createBpmEncoder } from '../bpmEncoder';
14
-
15
- describe('image', function () {
16
- it('mixValues', function () {
17
- expect(mixValues(420, 0.69, 96)).equal(320);
18
- expect(mixValues(420, 1, 96)).equal(420);
19
- expect(mixValues(420, 0, 96)).equal(96);
20
- });
21
-
22
- it('mixColors', function () {
23
- const result1 = mixColors({
24
- color: { red: 123, green: 69, blue: 96 },
25
- colorOpacity: 0.24,
26
- backgroundColor: { red: 69, green: 123, blue: 42 },
27
- });
28
- expect(result1).deep.equal({ red: 82, green: 110, blue: 55 });
29
-
30
- const result2 = mixColors({
31
- color: { red: 123, green: 69, blue: 96 },
32
- colorOpacity: 0,
33
- backgroundColor: { red: 69, green: 123, blue: 42 },
34
- });
35
- expect(result2).deep.equal({ red: 69, green: 123, blue: 42 });
36
-
37
- const result3 = mixColors({
38
- color: { red: 123, green: 69, blue: 96 },
39
- colorOpacity: 1,
40
- backgroundColor: { red: 69, green: 123, blue: 42 },
41
- });
42
- expect(result3).deep.equal({ red: 123, green: 69, blue: 96 });
43
- });
44
-
45
- it('drawRect', function () {
46
- const imageWidth = 10;
47
- const imageHeight = 10;
48
- const extraBytes = imageWidth % 4;
49
- const rowBytes = 3 * imageWidth + extraBytes;
50
- const imageDstBuffer = {
51
- shiftPos: 54,
52
- rowBytes,
53
- width: imageWidth,
54
- data: Array.from({ length: imageWidth * imageHeight * 4 }).fill(0)
55
- };
56
- const rectX = 4;
57
- const rectY = 3;
58
- const rectWidth = 4;
59
- const rectHeight = 3;
60
- const rectColor: Color = { red: 111, green: 112, blue: 123 };
61
-
62
- const expectedImageData = Array.from({ length: imageWidth * imageWidth * 4 }).fill(0);
63
- const imagePixelIndices = [162, 165, 168, 171, 194, 197, 200, 203, 226, 229, 232, 235];
64
- imagePixelIndices.forEach((pixelIndex) => {
65
- expectedImageData[pixelIndex] = rectColor.blue;
66
- expectedImageData[pixelIndex + 1] = rectColor.green;
67
- expectedImageData[pixelIndex + 2] = rectColor.red;
68
- });
69
-
70
- drawRect({
71
- imageDstBuffer: imageDstBuffer as any,
72
- position: { x: rectX, y: rectY },
73
- size: { width: rectWidth, height: rectHeight },
74
- color: rectColor,
75
- opacity: 1
76
- });
77
- expect(imageDstBuffer.data).deep.equal(expectedImageData);
78
- });
79
-
80
- it('createSpectrumVisualizerFrameGenerator', async function () {
81
- const expectedImageLength = 6220854;
82
- const backgroundImagePath = path.resolve('example/media/horses.png');
83
- const backgroundImageBmpBuffer = await convertToBmp(backgroundImagePath);
84
- const backgroundImage = parseImage(backgroundImageBmpBuffer);
85
- const bpmEncoder = createBpmEncoder({ width: backgroundImage.width, height: backgroundImage.height });
86
- const backgroundImageBuffer = bpmEncoder(backgroundImage.data);
87
- const createVisualizerFrame = createSpectrumVisualizerFrameGenerator();
88
- const frameSpectrumDown = createVisualizerFrame({
89
- backgroundImageBuffer,
90
- spectrum: [0.5, 0, 1],
91
- size: { width: 15, height: 20 },
92
- position: { x: 15, y: 0 },
93
- rotation: 'down',
94
- margin: 4,
95
- color: { red: 1, green: 1, blue: 1 },
96
- opacity: 1,
97
- });
98
- const resultSpectrumDown = frameSpectrumDown.data.toJSON().data;
99
- expect(resultSpectrumDown).to.have.length(expectedImageLength);
100
-
101
- const frameSpectrumUp = createVisualizerFrame({
102
- backgroundImageBuffer,
103
- spectrum: [0.1, 1, 0],
104
- size: { width: 25, height: 23 },
105
- position: { x: 10, y: 5 },
106
- rotation: 'up',
107
- margin: 4,
108
- color: { red: 0, green: 123, blue: 69 },
109
- opacity: 1,
110
- });
111
- const resultSpectrumUp = frameSpectrumUp.data.toJSON().data;
112
- expect(resultSpectrumUp).to.have.length(expectedImageLength);
113
-
114
- const frameSpectrumMirror = createVisualizerFrame({
115
- backgroundImageBuffer,
116
- spectrum: [0.1, 1, 0],
117
- size: { width: 25, height: 23 },
118
- position: { x: 10, y: 5 },
119
- rotation: 'mirror',
120
- margin: 4,
121
- color: { red: 0, green: 123, blue: 69 },
122
- opacity: 1,
123
- });
124
- const resultSpectrumMirror = frameSpectrumMirror.data.toJSON().data;
125
- expect(resultSpectrumMirror).to.have.length(expectedImageLength);
126
-
127
- const frameSpectrumUpOpacity50 = createVisualizerFrame({
128
- backgroundImageBuffer,
129
- spectrum: [0.1, 1, 0],
130
- size: { width: 25, height: 23 },
131
- position: { x: 10, y: 5 },
132
- rotation: 'up',
133
- margin: 4,
134
- color: { red: 0, green: 123, blue: 69 },
135
- opacity: 0.5,
136
- });
137
- const resultSpectrumUpOpacity50 = frameSpectrumUpOpacity50.data.toJSON().data;
138
- expect(resultSpectrumUpOpacity50).to.have.length(expectedImageLength);
139
- });
140
-
141
- it('createPolarVisualizerFrameGenerator', async function () {
142
- const expectedImageLength = 6220854;
143
- const backgroundImagePath = path.resolve('example/media/horses.png');
144
- const backgroundImageBmpBuffer = await convertToBmp(backgroundImagePath);
145
- const backgroundImage = parseImage(backgroundImageBmpBuffer);
146
- const bpmEncoder = createBpmEncoder({ width: backgroundImage.width, height: backgroundImage.height });
147
- const backgroundImageBuffer = bpmEncoder(backgroundImage.data);
148
- const createPolarVisualizerFrame = createPolarVisualizerFrameGenerator();
149
-
150
- const framePolarBasic = createPolarVisualizerFrame({
151
- backgroundImageBuffer,
152
- spectrum: [0.5, 0.8, 0.3, 0.9, 0.6, 0.4, 0.7, 0.2],
153
- centerX: 500,
154
- centerY: 400,
155
- innerRadius: 100,
156
- maxBarLength: 150,
157
- barWidth: 5,
158
- color: { red: 255, green: 100, blue: 50 },
159
- opacity: 1,
160
- });
161
- const resultPolarBasic = framePolarBasic.data.toJSON().data;
162
- expect(resultPolarBasic).to.have.length(expectedImageLength);
163
-
164
- const framePolarVolume = createPolarVisualizerFrame({
165
- backgroundImageBuffer,
166
- spectrum: [0.2, 0.5, 0.8, 0.3, 0.6, 0.9, 0.4, 0.7],
167
- centerX: 500,
168
- centerY: 400,
169
- innerRadius: 80,
170
- maxBarLength: 120,
171
- barWidth: 4,
172
- color: { red: 100, green: 200, blue: 255 },
173
- opacity: 1,
174
- spectrumEffect: 'volume',
175
- });
176
- const resultPolarVolume = framePolarVolume.data.toJSON().data;
177
- expect(resultPolarVolume).to.have.length(expectedImageLength);
178
-
179
- const framePolarSmooth = createPolarVisualizerFrame({
180
- backgroundImageBuffer,
181
- spectrum: [0.7, 0.4, 0.9, 0.2, 0.5, 0.8, 0.3, 0.6],
182
- centerX: 500,
183
- centerY: 400,
184
- innerRadius: 90,
185
- maxBarLength: 130,
186
- barWidth: 6,
187
- color: { red: 255, green: 255, blue: 0 },
188
- opacity: 1,
189
- spectrumEffect: 'smooth',
190
- });
191
- const resultPolarSmooth = framePolarSmooth.data.toJSON().data;
192
- expect(resultPolarSmooth).to.have.length(expectedImageLength);
193
-
194
- const framePolarOpacity50 = createPolarVisualizerFrame({
195
- backgroundImageBuffer,
196
- spectrum: [0.6, 0.3, 0.8, 0.5, 0.4, 0.7, 0.2, 0.9],
197
- centerX: 500,
198
- centerY: 400,
199
- innerRadius: 100,
200
- maxBarLength: 140,
201
- barWidth: 5,
202
- color: { red: 0, green: 255, blue: 128 },
203
- opacity: 0.5,
204
- });
205
- const resultPolarOpacity50 = framePolarOpacity50.data.toJSON().data;
206
- expect(resultPolarOpacity50).to.have.length(expectedImageLength);
207
-
208
- const framePolarHexColor = createPolarVisualizerFrame({
209
- backgroundImageBuffer,
210
- spectrum: [0.5, 0.6, 0.7, 0.8, 0.9, 0.4, 0.3, 0.2],
211
- centerX: 500,
212
- centerY: 400,
213
- innerRadius: 110,
214
- maxBarLength: 160,
215
- barWidth: 7,
216
- color: '#FF5733',
217
- opacity: 1,
218
- });
219
- const resultPolarHexColor = framePolarHexColor.data.toJSON().data;
220
- expect(resultPolarHexColor).to.have.length(expectedImageLength);
221
- });
222
- });
1
+ import { expect } from 'chai';
2
+ import path from 'path';
3
+ import {
4
+ drawRect,
5
+ Color,
6
+ createSpectrumVisualizerFrameGenerator,
7
+ createPolarVisualizerFrameGenerator,
8
+ parseImage,
9
+ convertToBmp,
10
+ mixValues,
11
+ mixColors,
12
+ } from '../image';
13
+ import { createBpmEncoder } from '../bpmEncoder';
14
+
15
+ describe('image', function () {
16
+ it('mixValues', function () {
17
+ expect(mixValues(420, 0.69, 96)).equal(320);
18
+ expect(mixValues(420, 1, 96)).equal(420);
19
+ expect(mixValues(420, 0, 96)).equal(96);
20
+ });
21
+
22
+ it('mixColors', function () {
23
+ const result1 = mixColors({
24
+ color: { red: 123, green: 69, blue: 96 },
25
+ colorOpacity: 0.24,
26
+ backgroundColor: { red: 69, green: 123, blue: 42 },
27
+ });
28
+ expect(result1).deep.equal({ red: 82, green: 110, blue: 55 });
29
+
30
+ const result2 = mixColors({
31
+ color: { red: 123, green: 69, blue: 96 },
32
+ colorOpacity: 0,
33
+ backgroundColor: { red: 69, green: 123, blue: 42 },
34
+ });
35
+ expect(result2).deep.equal({ red: 69, green: 123, blue: 42 });
36
+
37
+ const result3 = mixColors({
38
+ color: { red: 123, green: 69, blue: 96 },
39
+ colorOpacity: 1,
40
+ backgroundColor: { red: 69, green: 123, blue: 42 },
41
+ });
42
+ expect(result3).deep.equal({ red: 123, green: 69, blue: 96 });
43
+ });
44
+
45
+ it('drawRect', function () {
46
+ const imageWidth = 10;
47
+ const imageHeight = 10;
48
+ const extraBytes = imageWidth % 4;
49
+ const rowBytes = 3 * imageWidth + extraBytes;
50
+ const imageDstBuffer = {
51
+ shiftPos: 54,
52
+ rowBytes,
53
+ width: imageWidth,
54
+ data: Array.from({ length: imageWidth * imageHeight * 4 }).fill(0)
55
+ };
56
+ const rectX = 4;
57
+ const rectY = 3;
58
+ const rectWidth = 4;
59
+ const rectHeight = 3;
60
+ const rectColor: Color = { red: 111, green: 112, blue: 123 };
61
+
62
+ const expectedImageData = Array.from({ length: imageWidth * imageWidth * 4 }).fill(0);
63
+ const imagePixelIndices = [162, 165, 168, 171, 194, 197, 200, 203, 226, 229, 232, 235];
64
+ imagePixelIndices.forEach((pixelIndex) => {
65
+ expectedImageData[pixelIndex] = rectColor.blue;
66
+ expectedImageData[pixelIndex + 1] = rectColor.green;
67
+ expectedImageData[pixelIndex + 2] = rectColor.red;
68
+ });
69
+
70
+ drawRect({
71
+ imageDstBuffer: imageDstBuffer as any,
72
+ position: { x: rectX, y: rectY },
73
+ size: { width: rectWidth, height: rectHeight },
74
+ color: rectColor,
75
+ opacity: 1
76
+ });
77
+ expect(imageDstBuffer.data).deep.equal(expectedImageData);
78
+ });
79
+
80
+ it('createSpectrumVisualizerFrameGenerator', async function () {
81
+ const expectedImageLength = 6220854;
82
+ const backgroundImagePath = path.resolve('example/media/horses.png');
83
+ const backgroundImageBmpBuffer = await convertToBmp(backgroundImagePath);
84
+ const backgroundImage = parseImage(backgroundImageBmpBuffer);
85
+ const bpmEncoder = createBpmEncoder({ width: backgroundImage.width, height: backgroundImage.height });
86
+ const backgroundImageBuffer = bpmEncoder(backgroundImage.data);
87
+ const createVisualizerFrame = createSpectrumVisualizerFrameGenerator();
88
+ const frameSpectrumDown = createVisualizerFrame({
89
+ backgroundImageBuffer,
90
+ spectrum: [0.5, 0, 1],
91
+ size: { width: 15, height: 20 },
92
+ position: { x: 15, y: 0 },
93
+ rotation: 'down',
94
+ margin: 4,
95
+ color: { red: 1, green: 1, blue: 1 },
96
+ opacity: 1,
97
+ });
98
+ const resultSpectrumDown = frameSpectrumDown.data.toJSON().data;
99
+ expect(resultSpectrumDown).to.have.length(expectedImageLength);
100
+
101
+ const frameSpectrumUp = createVisualizerFrame({
102
+ backgroundImageBuffer,
103
+ spectrum: [0.1, 1, 0],
104
+ size: { width: 25, height: 23 },
105
+ position: { x: 10, y: 5 },
106
+ rotation: 'up',
107
+ margin: 4,
108
+ color: { red: 0, green: 123, blue: 69 },
109
+ opacity: 1,
110
+ });
111
+ const resultSpectrumUp = frameSpectrumUp.data.toJSON().data;
112
+ expect(resultSpectrumUp).to.have.length(expectedImageLength);
113
+
114
+ const frameSpectrumMirror = createVisualizerFrame({
115
+ backgroundImageBuffer,
116
+ spectrum: [0.1, 1, 0],
117
+ size: { width: 25, height: 23 },
118
+ position: { x: 10, y: 5 },
119
+ rotation: 'mirror',
120
+ margin: 4,
121
+ color: { red: 0, green: 123, blue: 69 },
122
+ opacity: 1,
123
+ });
124
+ const resultSpectrumMirror = frameSpectrumMirror.data.toJSON().data;
125
+ expect(resultSpectrumMirror).to.have.length(expectedImageLength);
126
+
127
+ const frameSpectrumUpOpacity50 = createVisualizerFrame({
128
+ backgroundImageBuffer,
129
+ spectrum: [0.1, 1, 0],
130
+ size: { width: 25, height: 23 },
131
+ position: { x: 10, y: 5 },
132
+ rotation: 'up',
133
+ margin: 4,
134
+ color: { red: 0, green: 123, blue: 69 },
135
+ opacity: 0.5,
136
+ });
137
+ const resultSpectrumUpOpacity50 = frameSpectrumUpOpacity50.data.toJSON().data;
138
+ expect(resultSpectrumUpOpacity50).to.have.length(expectedImageLength);
139
+ });
140
+
141
+ it('createPolarVisualizerFrameGenerator', async function () {
142
+ const expectedImageLength = 6220854;
143
+ const backgroundImagePath = path.resolve('example/media/horses.png');
144
+ const backgroundImageBmpBuffer = await convertToBmp(backgroundImagePath);
145
+ const backgroundImage = parseImage(backgroundImageBmpBuffer);
146
+ const bpmEncoder = createBpmEncoder({ width: backgroundImage.width, height: backgroundImage.height });
147
+ const backgroundImageBuffer = bpmEncoder(backgroundImage.data);
148
+ const createPolarVisualizerFrame = createPolarVisualizerFrameGenerator();
149
+
150
+ const framePolarBasic = createPolarVisualizerFrame({
151
+ backgroundImageBuffer,
152
+ spectrum: [0.5, 0.8, 0.3, 0.9, 0.6, 0.4, 0.7, 0.2],
153
+ centerX: 500,
154
+ centerY: 400,
155
+ innerRadius: 100,
156
+ maxBarLength: 150,
157
+ barWidth: 5,
158
+ color: { red: 255, green: 100, blue: 50 },
159
+ opacity: 1,
160
+ });
161
+ const resultPolarBasic = framePolarBasic.data.toJSON().data;
162
+ expect(resultPolarBasic).to.have.length(expectedImageLength);
163
+
164
+ const framePolarVolume = createPolarVisualizerFrame({
165
+ backgroundImageBuffer,
166
+ spectrum: [0.2, 0.5, 0.8, 0.3, 0.6, 0.9, 0.4, 0.7],
167
+ centerX: 500,
168
+ centerY: 400,
169
+ innerRadius: 80,
170
+ maxBarLength: 120,
171
+ barWidth: 4,
172
+ color: { red: 100, green: 200, blue: 255 },
173
+ opacity: 1,
174
+ spectrumEffect: 'volume',
175
+ });
176
+ const resultPolarVolume = framePolarVolume.data.toJSON().data;
177
+ expect(resultPolarVolume).to.have.length(expectedImageLength);
178
+
179
+ const framePolarSmooth = createPolarVisualizerFrame({
180
+ backgroundImageBuffer,
181
+ spectrum: [0.7, 0.4, 0.9, 0.2, 0.5, 0.8, 0.3, 0.6],
182
+ centerX: 500,
183
+ centerY: 400,
184
+ innerRadius: 90,
185
+ maxBarLength: 130,
186
+ barWidth: 6,
187
+ color: { red: 255, green: 255, blue: 0 },
188
+ opacity: 1,
189
+ spectrumEffect: 'smooth',
190
+ });
191
+ const resultPolarSmooth = framePolarSmooth.data.toJSON().data;
192
+ expect(resultPolarSmooth).to.have.length(expectedImageLength);
193
+
194
+ const framePolarOpacity50 = createPolarVisualizerFrame({
195
+ backgroundImageBuffer,
196
+ spectrum: [0.6, 0.3, 0.8, 0.5, 0.4, 0.7, 0.2, 0.9],
197
+ centerX: 500,
198
+ centerY: 400,
199
+ innerRadius: 100,
200
+ maxBarLength: 140,
201
+ barWidth: 5,
202
+ color: { red: 0, green: 255, blue: 128 },
203
+ opacity: 0.5,
204
+ });
205
+ const resultPolarOpacity50 = framePolarOpacity50.data.toJSON().data;
206
+ expect(resultPolarOpacity50).to.have.length(expectedImageLength);
207
+
208
+ const framePolarHexColor = createPolarVisualizerFrame({
209
+ backgroundImageBuffer,
210
+ spectrum: [0.5, 0.6, 0.7, 0.8, 0.9, 0.4, 0.3, 0.2],
211
+ centerX: 500,
212
+ centerY: 400,
213
+ innerRadius: 110,
214
+ maxBarLength: 160,
215
+ barWidth: 7,
216
+ color: '#FF5733',
217
+ opacity: 1,
218
+ });
219
+ const resultPolarHexColor = framePolarHexColor.data.toJSON().data;
220
+ expect(resultPolarHexColor).to.have.length(expectedImageLength);
221
+ });
222
+ });
@@ -1,63 +1,63 @@
1
- import { expect } from 'chai';
2
- import { createSandbox } from 'sinon';
3
- import { renderAudioVisualizer, Config } from '../index';
4
- import path from 'path';
5
- import fs from 'fs';
6
- import { Writable, Readable } from 'stream';
7
- import { ChildProcessWithoutNullStreams } from 'child_process';
8
- import * as image from '../image';
9
- import * as audio from '../audio';
10
- import * as video from '../video';
11
-
12
- const EXIT_CODE = 0;
13
- const sandbox = createSandbox();
14
-
15
- describe('index', function () {
16
-
17
- this.beforeAll(function () {
18
- sandbox.stub(fs, 'readFileSync').returns(Buffer.from([1, 1]));
19
- sandbox.stub(audio, 'createAudioBuffer').returns(
20
- new Promise(resolve => resolve({ audioBuffer: Buffer.from([1, 1]), sampleRate: 2 }))
21
- );
22
- sandbox.stub(image, 'getImageColor').returns({ red: 0, green: 0, blue: 0 });
23
-
24
- let exitCallback: Function = () => { };
25
- const stdin = new Writable({
26
- write(_chunk: Buffer, _enc: string, cb: (error?: Error | null) => void) {
27
- exitCallback(EXIT_CODE);
28
- cb();
29
- },
30
- });
31
- let childProcessStream: unknown = {
32
- stdin,
33
- stderr: new Readable(),
34
- on: function (_: string, callback: Function) {
35
- exitCallback = callback;
36
- },
37
- };
38
- sandbox.stub(video, 'spawnFfmpegVideoWriter').returns(childProcessStream as ChildProcessWithoutNullStreams);
39
- });
40
-
41
- this.afterAll(function () {
42
- sandbox.restore();
43
- });
44
-
45
- it('renderAudioVisualizer', async function () {
46
- const config: Config = {
47
- audio: {
48
- path: 'audioPath'
49
- },
50
- image: {
51
- path: 'example/media/horses.png'
52
- },
53
- outVideo: {
54
- path: 'outVideoPath',
55
- fps: 1
56
- }
57
- };
58
-
59
- const { exitCode, outputVideoFiles } = await renderAudioVisualizer(config);
60
- expect(exitCode).equal(EXIT_CODE);
61
- expect(outputVideoFiles).deep.equal([path.resolve('outVideoPath')]);
62
- });
63
- });
1
+ import { expect } from 'chai';
2
+ import { createSandbox } from 'sinon';
3
+ import { renderAudioVisualizer, Config } from '../index';
4
+ import path from 'path';
5
+ import fs from 'fs';
6
+ import { Writable, Readable } from 'stream';
7
+ import { ChildProcessWithoutNullStreams } from 'child_process';
8
+ import * as image from '../image';
9
+ import * as audio from '../audio';
10
+ import * as video from '../video';
11
+
12
+ const EXIT_CODE = 0;
13
+ const sandbox = createSandbox();
14
+
15
+ describe('index', function () {
16
+
17
+ this.beforeAll(function () {
18
+ sandbox.stub(fs, 'readFileSync').returns(Buffer.from([1, 1]));
19
+ sandbox.stub(audio, 'createAudioBuffer').returns(
20
+ new Promise(resolve => resolve({ audioBuffer: Buffer.from([1, 1]), sampleRate: 2 }))
21
+ );
22
+ sandbox.stub(image, 'getImageColor').returns({ red: 0, green: 0, blue: 0 });
23
+
24
+ let exitCallback: Function = () => { };
25
+ const stdin = new Writable({
26
+ write(_chunk: Buffer, _enc: string, cb: (error?: Error | null) => void) {
27
+ exitCallback(EXIT_CODE);
28
+ cb();
29
+ },
30
+ });
31
+ let childProcessStream: unknown = {
32
+ stdin,
33
+ stderr: new Readable(),
34
+ on: function (_: string, callback: Function) {
35
+ exitCallback = callback;
36
+ },
37
+ };
38
+ sandbox.stub(video, 'spawnFfmpegVideoWriter').returns(childProcessStream as ChildProcessWithoutNullStreams);
39
+ });
40
+
41
+ this.afterAll(function () {
42
+ sandbox.restore();
43
+ });
44
+
45
+ it('renderAudioVisualizer', async function () {
46
+ const config: Config = {
47
+ audio: {
48
+ path: 'audioPath'
49
+ },
50
+ image: {
51
+ path: 'example/media/horses.png'
52
+ },
53
+ outVideo: {
54
+ path: 'outVideoPath',
55
+ fps: 1
56
+ }
57
+ };
58
+
59
+ const { exitCode, outputVideoFiles } = await renderAudioVisualizer(config);
60
+ expect(exitCode).equal(EXIT_CODE);
61
+ expect(outputVideoFiles).deep.equal([path.resolve('outVideoPath')]);
62
+ });
63
+ });