nodejs-audio-visualizer 4.3.7 → 4.3.9

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.
Files changed (47) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +75 -75
  3. package/dist/audio.d.ts +12 -12
  4. package/dist/audio.js +120 -120
  5. package/dist/beats.d.ts +19 -19
  6. package/dist/beats.js +43 -43
  7. package/dist/bpmEncoder.d.ts +14 -14
  8. package/dist/bpmEncoder.js +97 -97
  9. package/dist/config.d.ts +67 -67
  10. package/dist/config.js +356 -356
  11. package/dist/dsp.d.ts +16 -16
  12. package/dist/dsp.js +76 -76
  13. package/dist/highlight.d.ts +32 -32
  14. package/dist/highlight.js +325 -325
  15. package/dist/image.d.ts +79 -79
  16. package/dist/image.js +458 -458
  17. package/dist/index.d.ts +72 -72
  18. package/dist/index.js +539 -541
  19. package/dist/index.js.map +1 -1
  20. package/dist/subtitleConvert.d.ts +3 -3
  21. package/dist/subtitleConvert.js +61 -61
  22. package/dist/video.d.ts +77 -72
  23. package/dist/video.js +407 -338
  24. package/dist/video.js.map +1 -1
  25. package/dist/waitForEventLoop.d.ts +1 -1
  26. package/dist/waitForEventLoop.js +5 -5
  27. package/package.json +61 -61
  28. package/src/audio.ts +120 -120
  29. package/src/beats.ts +68 -68
  30. package/src/bpmEncoder.ts +97 -97
  31. package/src/config.ts +462 -462
  32. package/src/dsp.ts +95 -95
  33. package/src/highlight.ts +284 -284
  34. package/src/image.ts +602 -602
  35. package/src/index.ts +693 -678
  36. package/src/subtitleConvert.ts +63 -63
  37. package/src/tests/audio.test.ts +96 -96
  38. package/src/tests/config.test.ts +475 -475
  39. package/src/tests/dsp.test.ts +24 -24
  40. package/src/tests/highlight.test.ts +178 -178
  41. package/src/tests/image.test.ts +222 -222
  42. package/src/tests/index.test.ts +156 -63
  43. package/src/tests/subtitleConvert.test.ts +23 -23
  44. package/src/tests/video.test.ts +214 -138
  45. package/src/typings.d.ts +6 -6
  46. package/src/video.ts +517 -437
  47. package/src/waitForEventLoop.ts +2 -2
package/dist/index.d.ts CHANGED
@@ -1,72 +1,72 @@
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
- subtitles?: string | {
28
- path?: string;
29
- rawContent?: string;
30
- alignment?: 'top' | 'middle' | 'bottom';
31
- };
32
- fps?: number;
33
- resolution?: {
34
- width: number;
35
- height: number;
36
- };
37
- spectrum?: {
38
- width?: SpectrumSizeValue;
39
- height?: SpectrumSizeValue;
40
- x?: number | PositionAliasName;
41
- y?: number | PositionAliasName;
42
- rotation?: RotationAliasName;
43
- effect?: SpectrumEffect;
44
- color?: Color | string;
45
- opacity?: string;
46
- };
47
- polar?: {
48
- x?: number | PositionAliasName;
49
- y?: number | PositionAliasName;
50
- innerRadius?: number;
51
- maxBarLength?: number;
52
- barWidth?: number;
53
- effect?: SpectrumEffect;
54
- color?: Color | string;
55
- opacity?: string;
56
- };
57
- };
58
- tweaks?: {
59
- ffmpeg_cfr?: string;
60
- ffmpeg_preset?: string;
61
- frame_processing_delay?: number;
62
- };
63
- }
64
- export declare type SpectrumSizeValue = number | string;
65
- export declare type PositionAliasName = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
66
- export declare type RotationAliasName = typeof rotationAliasValues[number];
67
- export interface RenderAudioVisualizerResult {
68
- exitCode: number;
69
- /** Absolute paths of video files written successfully (exit code 0, full pass, no early stop). */
70
- outputVideoFiles: string[];
71
- }
72
- 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
+ subtitles?: string | {
28
+ path?: string;
29
+ rawContent?: string;
30
+ alignment?: 'top' | 'middle' | 'bottom';
31
+ };
32
+ fps?: number;
33
+ resolution?: {
34
+ width: number;
35
+ height: number;
36
+ };
37
+ spectrum?: {
38
+ width?: SpectrumSizeValue;
39
+ height?: SpectrumSizeValue;
40
+ x?: number | PositionAliasName;
41
+ y?: number | PositionAliasName;
42
+ rotation?: RotationAliasName;
43
+ effect?: SpectrumEffect;
44
+ color?: Color | string;
45
+ opacity?: string;
46
+ };
47
+ polar?: {
48
+ x?: number | PositionAliasName;
49
+ y?: number | PositionAliasName;
50
+ innerRadius?: number;
51
+ maxBarLength?: number;
52
+ barWidth?: number;
53
+ effect?: SpectrumEffect;
54
+ color?: Color | string;
55
+ opacity?: string;
56
+ };
57
+ };
58
+ tweaks?: {
59
+ ffmpeg_cfr?: string;
60
+ ffmpeg_preset?: string;
61
+ frame_processing_delay?: number;
62
+ };
63
+ }
64
+ export declare type SpectrumSizeValue = number | string;
65
+ export declare type PositionAliasName = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
66
+ export declare type RotationAliasName = typeof rotationAliasValues[number];
67
+ export interface RenderAudioVisualizerResult {
68
+ exitCode: number;
69
+ /** Absolute paths of video files written successfully (exit code 0, full pass, no early stop). */
70
+ outputVideoFiles: string[];
71
+ }
72
+ export declare const renderAudioVisualizer: (config: Config, onProgress?: ((progress: number) => any) | undefined, shouldStop?: (() => boolean) | undefined) => Promise<RenderAudioVisualizerResult>;