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.
- package/LICENSE +21 -21
- package/README.md +70 -70
- package/dist/audio.d.ts +12 -12
- package/dist/audio.js +120 -120
- package/dist/beats.d.ts +19 -19
- package/dist/beats.js +43 -43
- package/dist/bpmEncoder.d.ts +14 -14
- package/dist/bpmEncoder.js +97 -97
- package/dist/config.d.ts +54 -54
- package/dist/config.js +299 -299
- package/dist/dsp.d.ts +16 -16
- package/dist/dsp.js +76 -76
- package/dist/highlight.d.ts +32 -32
- package/dist/highlight.js +325 -325
- package/dist/image.d.ts +79 -79
- package/dist/image.js +458 -458
- package/dist/index.d.ts +67 -67
- package/dist/index.js +497 -466
- package/dist/index.js.map +1 -1
- package/dist/video.d.ts +67 -64
- package/dist/video.js +317 -293
- package/dist/video.js.map +1 -1
- package/dist/waitForEventLoop.d.ts +1 -1
- package/dist/waitForEventLoop.js +5 -5
- package/package.json +61 -61
- package/src/audio.ts +120 -120
- package/src/beats.ts +68 -68
- package/src/bpmEncoder.ts +97 -97
- package/src/config.ts +382 -382
- package/src/dsp.ts +95 -95
- package/src/highlight.ts +284 -284
- package/src/image.ts +602 -602
- package/src/index.ts +631 -606
- package/src/tests/audio.test.ts +96 -96
- package/src/tests/config.test.ts +406 -406
- package/src/tests/dsp.test.ts +24 -24
- package/src/tests/highlight.test.ts +178 -178
- package/src/tests/image.test.ts +222 -222
- package/src/tests/index.test.ts +63 -63
- package/src/tests/video.test.ts +71 -71
- package/src/typings.d.ts +6 -6
- package/src/video.ts +403 -375
- package/src/waitForEventLoop.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { rotationAliasValues, SpectrumEffect } from './config';
|
|
3
|
-
import { Color } from './image';
|
|
4
|
-
export { BeatInfo, BeatDetectorOptions } from './beats';
|
|
5
|
-
export { computeHighlightSlice, HIGHLIGHT_DURATION_SEC, BeatFrameEvent, HighlightAudioSegment, HighlightRun } from './highlight';
|
|
6
|
-
export declare const PCM_FORMAT: {
|
|
7
|
-
bit: number;
|
|
8
|
-
sign: string;
|
|
9
|
-
parseFunction: (buffer: Buffer, start: number, end: number) => number[];
|
|
10
|
-
};
|
|
11
|
-
export interface Config {
|
|
12
|
-
audio: {
|
|
13
|
-
path: string;
|
|
14
|
-
autoHighlight?: boolean;
|
|
15
|
-
/** When `autoHighlight` is true, number of non-overlapping 15s windows to stitch (default 1). */
|
|
16
|
-
autoHighlightCount?: number;
|
|
17
|
-
};
|
|
18
|
-
image?: {
|
|
19
|
-
path: string;
|
|
20
|
-
};
|
|
21
|
-
video?: {
|
|
22
|
-
path: string;
|
|
23
|
-
autoEdit?: boolean;
|
|
24
|
-
};
|
|
25
|
-
outVideo: {
|
|
26
|
-
path: string;
|
|
27
|
-
fps?: number;
|
|
28
|
-
resolution?: {
|
|
29
|
-
width: number;
|
|
30
|
-
height: number;
|
|
31
|
-
};
|
|
32
|
-
spectrum?: {
|
|
33
|
-
width?: SpectrumSizeValue;
|
|
34
|
-
height?: SpectrumSizeValue;
|
|
35
|
-
x?: number | PositionAliasName;
|
|
36
|
-
y?: number | PositionAliasName;
|
|
37
|
-
rotation?: RotationAliasName;
|
|
38
|
-
effect?: SpectrumEffect;
|
|
39
|
-
color?: Color | string;
|
|
40
|
-
opacity?: string;
|
|
41
|
-
};
|
|
42
|
-
polar?: {
|
|
43
|
-
x?: number | PositionAliasName;
|
|
44
|
-
y?: number | PositionAliasName;
|
|
45
|
-
innerRadius?: number;
|
|
46
|
-
maxBarLength?: number;
|
|
47
|
-
barWidth?: number;
|
|
48
|
-
effect?: SpectrumEffect;
|
|
49
|
-
color?: Color | string;
|
|
50
|
-
opacity?: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
tweaks?: {
|
|
54
|
-
ffmpeg_cfr?: string;
|
|
55
|
-
ffmpeg_preset?: string;
|
|
56
|
-
frame_processing_delay?: number;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
export declare type SpectrumSizeValue = number | string;
|
|
60
|
-
export declare type PositionAliasName = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
|
61
|
-
export declare type RotationAliasName = typeof rotationAliasValues[number];
|
|
62
|
-
export interface RenderAudioVisualizerResult {
|
|
63
|
-
exitCode: number;
|
|
64
|
-
/** Absolute paths of video files written successfully (exit code 0, full pass, no early stop). */
|
|
65
|
-
outputVideoFiles: string[];
|
|
66
|
-
}
|
|
67
|
-
export declare const renderAudioVisualizer: (config: Config, onProgress?: ((progress: number) => any) | undefined, shouldStop?: (() => boolean) | undefined) => Promise<RenderAudioVisualizerResult>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { rotationAliasValues, SpectrumEffect } from './config';
|
|
3
|
+
import { Color } from './image';
|
|
4
|
+
export { BeatInfo, BeatDetectorOptions } from './beats';
|
|
5
|
+
export { computeHighlightSlice, HIGHLIGHT_DURATION_SEC, BeatFrameEvent, HighlightAudioSegment, HighlightRun } from './highlight';
|
|
6
|
+
export declare const PCM_FORMAT: {
|
|
7
|
+
bit: number;
|
|
8
|
+
sign: string;
|
|
9
|
+
parseFunction: (buffer: Buffer, start: number, end: number) => number[];
|
|
10
|
+
};
|
|
11
|
+
export interface Config {
|
|
12
|
+
audio: {
|
|
13
|
+
path: string;
|
|
14
|
+
autoHighlight?: boolean;
|
|
15
|
+
/** When `autoHighlight` is true, number of non-overlapping 15s windows to stitch (default 1). */
|
|
16
|
+
autoHighlightCount?: number;
|
|
17
|
+
};
|
|
18
|
+
image?: {
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
21
|
+
video?: {
|
|
22
|
+
path: string;
|
|
23
|
+
autoEdit?: boolean;
|
|
24
|
+
};
|
|
25
|
+
outVideo: {
|
|
26
|
+
path: string;
|
|
27
|
+
fps?: number;
|
|
28
|
+
resolution?: {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
32
|
+
spectrum?: {
|
|
33
|
+
width?: SpectrumSizeValue;
|
|
34
|
+
height?: SpectrumSizeValue;
|
|
35
|
+
x?: number | PositionAliasName;
|
|
36
|
+
y?: number | PositionAliasName;
|
|
37
|
+
rotation?: RotationAliasName;
|
|
38
|
+
effect?: SpectrumEffect;
|
|
39
|
+
color?: Color | string;
|
|
40
|
+
opacity?: string;
|
|
41
|
+
};
|
|
42
|
+
polar?: {
|
|
43
|
+
x?: number | PositionAliasName;
|
|
44
|
+
y?: number | PositionAliasName;
|
|
45
|
+
innerRadius?: number;
|
|
46
|
+
maxBarLength?: number;
|
|
47
|
+
barWidth?: number;
|
|
48
|
+
effect?: SpectrumEffect;
|
|
49
|
+
color?: Color | string;
|
|
50
|
+
opacity?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
tweaks?: {
|
|
54
|
+
ffmpeg_cfr?: string;
|
|
55
|
+
ffmpeg_preset?: string;
|
|
56
|
+
frame_processing_delay?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export declare type SpectrumSizeValue = number | string;
|
|
60
|
+
export declare type PositionAliasName = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
|
61
|
+
export declare type RotationAliasName = typeof rotationAliasValues[number];
|
|
62
|
+
export interface RenderAudioVisualizerResult {
|
|
63
|
+
exitCode: number;
|
|
64
|
+
/** Absolute paths of video files written successfully (exit code 0, full pass, no early stop). */
|
|
65
|
+
outputVideoFiles: string[];
|
|
66
|
+
}
|
|
67
|
+
export declare const renderAudioVisualizer: (config: Config, onProgress?: ((progress: number) => any) | undefined, shouldStop?: (() => boolean) | undefined) => Promise<RenderAudioVisualizerResult>;
|