@remotion/media-utils 4.0.0-audiopipeline.59 → 4.0.0-fastlambda.10

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 (64) hide show
  1. package/dist/audio-buffer/audio-buffer-to-wav.d.ts +0 -1
  2. package/dist/audio-buffer/audio-buffer-to-wav.js +0 -1
  3. package/dist/audio-buffer/audio-url-helpers.d.ts +0 -1
  4. package/dist/audio-buffer/audio-url-helpers.js +0 -1
  5. package/dist/fft/complex.d.ts +0 -1
  6. package/dist/fft/complex.js +0 -1
  7. package/dist/fft/exponent.d.ts +0 -1
  8. package/dist/fft/exponent.js +0 -1
  9. package/dist/fft/fft-freq.d.ts +1 -5
  10. package/dist/fft/fft-freq.d.ts.map +1 -1
  11. package/dist/fft/fft-freq.js +0 -1
  12. package/dist/fft/fft.d.ts +1 -5
  13. package/dist/fft/fft.d.ts.map +1 -1
  14. package/dist/fft/fft.js +0 -1
  15. package/dist/fft/get-visualization.d.ts +0 -1
  16. package/dist/fft/get-visualization.js +0 -1
  17. package/dist/fft/mag.d.ts +1 -5
  18. package/dist/fft/mag.d.ts.map +1 -1
  19. package/dist/fft/mag.js +0 -1
  20. package/dist/fft/max-value-cached.d.ts +0 -1
  21. package/dist/fft/max-value-cached.js +0 -1
  22. package/dist/fft/smoothing.d.ts +0 -1
  23. package/dist/fft/smoothing.js +0 -1
  24. package/dist/fft/to-int-16.d.ts +0 -1
  25. package/dist/fft/to-int-16.js +0 -1
  26. package/dist/get-audio-data.d.ts +0 -1
  27. package/dist/get-audio-data.js +0 -1
  28. package/dist/get-audio-duration.d.ts +0 -1
  29. package/dist/get-audio-duration.js +0 -1
  30. package/dist/get-video-metadata.d.ts +0 -1
  31. package/dist/get-video-metadata.js +0 -1
  32. package/dist/get-wave-form-samples.d.ts +0 -1
  33. package/dist/get-wave-form-samples.js +0 -1
  34. package/dist/get-waveform-portion.d.ts +0 -1
  35. package/dist/get-waveform-portion.js +0 -1
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.js +0 -1
  38. package/dist/is-remote-asset.d.ts +0 -1
  39. package/dist/is-remote-asset.js +0 -1
  40. package/dist/p-limit.d.ts +0 -1
  41. package/dist/p-limit.js +0 -1
  42. package/dist/types.d.ts +0 -1
  43. package/dist/types.js +0 -1
  44. package/dist/use-audio-data.d.ts +0 -1
  45. package/dist/use-audio-data.js +0 -1
  46. package/dist/visualize-audio.d.ts +0 -1
  47. package/dist/visualize-audio.js +0 -1
  48. package/package.json +3 -3
  49. package/dist/create-smooth-svg-path.d.ts +0 -5
  50. package/dist/create-smooth-svg-path.d.ts.map +0 -1
  51. package/dist/create-smooth-svg-path.js +0 -30
  52. package/dist/create-smooth-svg-path.js.map +0 -1
  53. package/dist/smooth-path.d.ts +0 -5
  54. package/dist/smooth-path.d.ts.map +0 -1
  55. package/dist/smooth-path.js +0 -30
  56. package/dist/smooth-path.js.map +0 -1
  57. package/dist/use-audio-metadata.d.ts +0 -3
  58. package/dist/use-audio-metadata.d.ts.map +0 -1
  59. package/dist/use-audio-metadata.js +0 -34
  60. package/dist/use-audio-metadata.js.map +0 -1
  61. package/dist/visualize-audio-waveform.d.ts +0 -11
  62. package/dist/visualize-audio-waveform.d.ts.map +0 -1
  63. package/dist/visualize-audio-waveform.js +0 -34
  64. package/dist/visualize-audio-waveform.js.map +0 -1
@@ -4,4 +4,3 @@
4
4
  export declare function audioBufferToWav(buffer: AudioBuffer, opt: {
5
5
  float32: boolean;
6
6
  }): ArrayBuffer;
7
- //# sourceMappingURL=audio-buffer-to-wav.d.ts.map
@@ -93,4 +93,3 @@ function writeString(view, offset, string) {
93
93
  view.setUint8(offset + i, string.charCodeAt(i));
94
94
  }
95
95
  }
96
- //# sourceMappingURL=audio-buffer-to-wav.js.map
@@ -1,2 +1 @@
1
1
  export declare const audioBufferToDataUrl: (buffer: AudioBuffer) => string;
2
- //# sourceMappingURL=audio-url-helpers.d.ts.map
@@ -15,4 +15,3 @@ const audioBufferToDataUrl = (buffer) => {
15
15
  return 'data:audio/wav;base64,' + window.btoa(binary);
16
16
  };
17
17
  exports.audioBufferToDataUrl = audioBufferToDataUrl;
18
- //# sourceMappingURL=audio-url-helpers.js.map
@@ -2,4 +2,3 @@ export declare const complexAdd: (a: [number, number], b: [number, number]) => [
2
2
  export declare const complexSubtract: (a: [number, number], b: [number, number]) => [number, number];
3
3
  export declare const complexMultiply: (a: [number, number], b: [number, number]) => [number, number];
4
4
  export declare const complexMagnitude: (c: [number, number]) => number;
5
- //# sourceMappingURL=complex.d.ts.map
@@ -19,4 +19,3 @@ const complexMagnitude = function (c) {
19
19
  return Math.sqrt(c[0] * c[0] + c[1] * c[1]);
20
20
  };
21
21
  exports.complexMagnitude = complexMagnitude;
22
- //# sourceMappingURL=complex.js.map
@@ -1,2 +1 @@
1
1
  export declare const exponent: (k: number, N: number) => [number, number];
2
- //# sourceMappingURL=exponent.d.ts.map
@@ -11,4 +11,3 @@ const exponent = function (k, N) {
11
11
  return mapExponent[N][k];
12
12
  };
13
13
  exports.exponent = exponent;
14
- //# sourceMappingURL=exponent.js.map
@@ -1,5 +1 @@
1
- export declare const fftFreq: (fftBins: [
2
- number,
3
- number
4
- ][], sampleRate: number) => number[];
5
- //# sourceMappingURL=fft-freq.d.ts.map
1
+ export declare const fftFreq: (fftBins: [number, number][], sampleRate: number) => number[];
@@ -1 +1 @@
1
- {"version":3,"file":"fft-freq.d.ts","sourceRoot":"","sources":["../../src/fft/fft-freq.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,YACV;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,cACf,MAAM,aAQlB,CAAC"}
1
+ {"version":3,"file":"fft-freq.d.ts","sourceRoot":"","sources":["../../src/fft/fft-freq.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,YACV,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,cACf,MAAM,aAQlB,CAAC"}
@@ -11,4 +11,3 @@ const fftFreq = function (fftBins, sampleRate) {
11
11
  });
12
12
  };
13
13
  exports.fftFreq = fftFreq;
14
- //# sourceMappingURL=fft-freq.js.map
package/dist/fft/fft.d.ts CHANGED
@@ -1,5 +1 @@
1
- export declare const fft: (vector: Int16Array) => [
2
- number,
3
- number
4
- ][];
5
- //# sourceMappingURL=fft.d.ts.map
1
+ export declare const fft: (vector: Int16Array) => [number, number][];
@@ -1 +1 @@
1
- {"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../../src/fft/fft.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,GAAG,WAAqB,UAAU,KAAG;IAAC,MAAM;IAAE,MAAM;CAAC,EA8BjE,CAAC"}
1
+ {"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../../src/fft/fft.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,GAAG,WAAqB,UAAU,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EA8BjE,CAAC"}
package/dist/fft/fft.js CHANGED
@@ -31,4 +31,3 @@ const fft = function (vector) {
31
31
  return X;
32
32
  };
33
33
  exports.fft = fft;
34
- //# sourceMappingURL=fft.js.map
@@ -6,4 +6,3 @@ export declare const getVisualization: ({ sampleSize, data, sampleRate, frame, f
6
6
  fps: number;
7
7
  maxInt: number;
8
8
  }) => number[];
9
- //# sourceMappingURL=get-visualization.d.ts.map
@@ -29,4 +29,3 @@ const getVisualization = ({ sampleSize, data, sampleRate, frame, fps, maxInt, })
29
29
  return (0, smoothing_1.smoothen)(magnitudes).map((m) => m / (sampleSize / 2) / maxInt);
30
30
  };
31
31
  exports.getVisualization = getVisualization;
32
- //# sourceMappingURL=get-visualization.js.map
package/dist/fft/mag.d.ts CHANGED
@@ -1,5 +1 @@
1
- export declare const fftMag: (fftBins: [
2
- number,
3
- number
4
- ][]) => number[];
5
- //# sourceMappingURL=mag.d.ts.map
1
+ export declare const fftMag: (fftBins: [number, number][]) => number[];
@@ -1 +1 @@
1
- {"version":3,"file":"mag.d.ts","sourceRoot":"","sources":["../../src/fft/mag.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,YAAsB;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,aAG1D,CAAC"}
1
+ {"version":3,"file":"mag.d.ts","sourceRoot":"","sources":["../../src/fft/mag.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,YAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,aAG1D,CAAC"}
package/dist/fft/mag.js CHANGED
@@ -9,4 +9,3 @@ const fftMag = function (fftBins) {
9
9
  return ret.slice(0, ret.length / 2);
10
10
  };
11
11
  exports.fftMag = fftMag;
12
- //# sourceMappingURL=mag.js.map
@@ -1,3 +1,2 @@
1
1
  import { AudioData } from '..';
2
2
  export declare const getMaxPossibleMagnitude: (metadata: AudioData) => number;
3
- //# sourceMappingURL=max-value-cached.d.ts.map
@@ -24,4 +24,3 @@ const getMaxPossibleMagnitude = (metadata) => {
24
24
  return result;
25
25
  };
26
26
  exports.getMaxPossibleMagnitude = getMaxPossibleMagnitude;
27
- //# sourceMappingURL=max-value-cached.js.map
@@ -1,2 +1 @@
1
1
  export declare const smoothen: (array: number[]) => number[];
2
- //# sourceMappingURL=smoothing.d.ts.map
@@ -27,4 +27,3 @@ const smoothen = function (array) {
27
27
  return newArr;
28
28
  };
29
29
  exports.smoothen = smoothen;
30
- //# sourceMappingURL=smoothing.js.map
@@ -1,2 +1 @@
1
1
  export declare const toInt16: (x: number) => number;
2
- //# sourceMappingURL=to-int-16.d.ts.map
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toInt16 = void 0;
4
4
  const toInt16 = (x) => (x > 0 ? x * 0x7fff : x * 0x8000);
5
5
  exports.toInt16 = toInt16;
6
- //# sourceMappingURL=to-int-16.js.map
@@ -1,3 +1,2 @@
1
1
  import { AudioData } from './types';
2
2
  export declare const getAudioData: (src: string) => Promise<AudioData>;
3
- //# sourceMappingURL=get-audio-data.d.ts.map
@@ -52,4 +52,3 @@ const getAudioData = (src) => {
52
52
  return limit(fn, src);
53
53
  };
54
54
  exports.getAudioData = getAudioData;
55
- //# sourceMappingURL=get-audio-data.js.map
@@ -9,4 +9,3 @@ export declare const getAudioDurationInSeconds: (src: string) => Promise<number>
9
9
  * @deprecated Renamed to `getAudioDurationInSeconds`
10
10
  */
11
11
  export declare const getAudioDuration: (src: string) => Promise<number>;
12
- //# sourceMappingURL=get-audio-duration.d.ts.map
@@ -44,4 +44,3 @@ exports.getAudioDurationInSeconds = getAudioDurationInSeconds;
44
44
  */
45
45
  const getAudioDuration = (src) => (0, exports.getAudioDurationInSeconds)(src);
46
46
  exports.getAudioDuration = getAudioDuration;
47
- //# sourceMappingURL=get-audio-duration.js.map
@@ -1,3 +1,2 @@
1
1
  import { VideoMetadata } from './types';
2
2
  export declare const getVideoMetadata: (src: string) => Promise<VideoMetadata>;
3
- //# sourceMappingURL=get-video-metadata.d.ts.map
@@ -41,4 +41,3 @@ const getVideoMetadata = (src) => {
41
41
  return limit(fn, src);
42
42
  };
43
43
  exports.getVideoMetadata = getVideoMetadata;
44
- //# sourceMappingURL=get-video-metadata.js.map
@@ -1,2 +1 @@
1
1
  export declare const getWaveformSamples: (waveform: Float32Array, sampleAmount: number) => number[];
2
- //# sourceMappingURL=get-wave-form-samples.d.ts.map
@@ -25,4 +25,3 @@ const getWaveformSamples = (waveform, sampleAmount) => {
25
25
  return normalizeData(filterData(waveform, sampleAmount));
26
26
  };
27
27
  exports.getWaveformSamples = getWaveformSamples;
28
- //# sourceMappingURL=get-wave-form-samples.js.map
@@ -10,4 +10,3 @@ export declare const getWaveformPortion: ({ audioData, startTimeInSeconds, durat
10
10
  numberOfSamples: number;
11
11
  }) => Bar[];
12
12
  export {};
13
- //# sourceMappingURL=get-waveform-portion.d.ts.map
@@ -15,4 +15,3 @@ const getWaveformPortion = ({ audioData, startTimeInSeconds, durationInSeconds,
15
15
  });
16
16
  };
17
17
  exports.getWaveformPortion = getWaveformPortion;
18
- //# sourceMappingURL=get-waveform-portion.js.map
package/dist/index.d.ts CHANGED
@@ -7,4 +7,3 @@ export * from './types';
7
7
  export type { AudioData, VideoMetadata as VideoData } from './types';
8
8
  export { useAudioData } from './use-audio-data';
9
9
  export { visualizeAudio } from './visualize-audio';
10
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -27,4 +27,3 @@ var use_audio_data_1 = require("./use-audio-data");
27
27
  Object.defineProperty(exports, "useAudioData", { enumerable: true, get: function () { return use_audio_data_1.useAudioData; } });
28
28
  var visualize_audio_1 = require("./visualize-audio");
29
29
  Object.defineProperty(exports, "visualizeAudio", { enumerable: true, get: function () { return visualize_audio_1.visualizeAudio; } });
30
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export declare const isRemoteAsset: (asset: string) => boolean;
2
- //# sourceMappingURL=is-remote-asset.d.ts.map
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRemoteAsset = void 0;
4
4
  const isRemoteAsset = (asset) => !asset.startsWith(window.location.origin) && !asset.startsWith('data');
5
5
  exports.isRemoteAsset = isRemoteAsset;
6
- //# sourceMappingURL=is-remote-asset.js.map
package/dist/p-limit.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export declare const pLimit: (concurrency: number) => <Arguments extends unknown[], ReturnType_1>(fn: (..._arguments: Arguments) => ReturnType_1 | PromiseLike<ReturnType_1>, ...args: Arguments) => Promise<ReturnType_1>;
2
- //# sourceMappingURL=p-limit.d.ts.map
package/dist/p-limit.js CHANGED
@@ -55,4 +55,3 @@ const pLimit = (concurrency) => {
55
55
  return generator;
56
56
  };
57
57
  exports.pLimit = pLimit;
58
- //# sourceMappingURL=p-limit.js.map
package/dist/types.d.ts CHANGED
@@ -13,4 +13,3 @@ export declare type VideoMetadata = {
13
13
  aspectRatio: number;
14
14
  isRemote: boolean;
15
15
  };
16
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1,3 +1,2 @@
1
1
  import { AudioData } from './types';
2
2
  export declare const useAudioData: (src: string) => AudioData | null;
3
- //# sourceMappingURL=use-audio-data.d.ts.map
@@ -31,4 +31,3 @@ const useAudioData = (src) => {
31
31
  return metadata;
32
32
  };
33
33
  exports.useAudioData = useAudioData;
34
- //# sourceMappingURL=use-audio-data.js.map
@@ -9,4 +9,3 @@ export declare const visualizeAudio: ({ smoothing, ...parameters }: FnParameters
9
9
  smoothing?: boolean | undefined;
10
10
  }) => number[];
11
11
  export {};
12
- //# sourceMappingURL=visualize-audio.d.ts.map
@@ -41,4 +41,3 @@ const visualizeAudio = ({ smoothing = true, ...parameters }) => {
41
41
  });
42
42
  };
43
43
  exports.visualizeAudio = visualizeAudio;
44
- //# sourceMappingURL=visualize-audio.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media-utils",
3
- "version": "4.0.0-audiopipeline.59+849c7f15c",
3
+ "version": "4.0.0-fastlambda.10+edb45658f",
4
4
  "description": "Utility functions for audio and video",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/remotion-dev/remotion/issues"
19
19
  },
20
20
  "dependencies": {
21
- "remotion": "4.0.0-audiopipeline.59+849c7f15c"
21
+ "remotion": "4.0.0-fastlambda.10+edb45658f"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "849c7f15cb9069615f0fb49f4a6a8652153c199f"
47
+ "gitHead": "edb45658f8bd699a15e07613d6bde85cca9ca2ac"
48
48
  }
@@ -1,5 +0,0 @@
1
- export declare const createSmoothSvgPath: (points: [
2
- number,
3
- number
4
- ][]) => string | null;
5
- //# sourceMappingURL=create-smooth-svg-path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-smooth-svg-path.d.ts","sourceRoot":"","sources":["../src/create-smooth-svg-path.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAY;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,kBA6B7D,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSmoothSvgPath = void 0;
4
- const createSmoothSvgPath = (points) => {
5
- return points.reduce((acc, point, i, a) => {
6
- if (i === 0) {
7
- return `M ${point[0]},${point[1]}`;
8
- }
9
- const p0 = a[i - 2] || a[i - 1];
10
- const x0 = p0[0];
11
- const y0 = p0[1];
12
- const p1 = a[i - 1];
13
- const x1 = p1[0];
14
- const y1 = p1[1];
15
- const x = point[0];
16
- const y = point[1];
17
- const cp1x = (2 * x0 + x1) / 3;
18
- const cp1y = (2 * y0 + y1) / 3;
19
- const cp2x = (x0 + 2 * x1) / 3;
20
- const cp2y = (y0 + 2 * y1) / 3;
21
- const cp3x = (x0 + 4 * x1 + x) / 6;
22
- const cp3y = (y0 + 4 * y1 + y) / 6;
23
- if (i === a.length - 1) {
24
- return `${acc} C ${cp1x},${cp1y} ${cp2x},${cp2y} ${cp3x},${cp3y} C${x},${y} ${x},${y} ${x},${y}`;
25
- }
26
- return `${acc} C ${cp1x},${cp1y} ${cp2x},${cp2y} ${cp3x},${cp3y}`;
27
- }, '');
28
- };
29
- exports.createSmoothSvgPath = createSmoothSvgPath;
30
- //# sourceMappingURL=create-smooth-svg-path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-smooth-svg-path.js","sourceRoot":"","sources":["../src/create-smooth-svg-path.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,CAAC,MAA0B,EAAE,EAAE;IACjE,OAAO,MAAM,CAAC,MAAM,CACnB,CAAC,GAAkB,EAAE,KAAuB,EAAE,CAAS,EAAE,CAAC,EAAE,EAAE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,GAAG,GAAG,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACjG;QAED,OAAO,GAAG,GAAG,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;IACnE,CAAC,EACD,EAAE,CACF,CAAC;AACH,CAAC,CAAC;AA7BW,QAAA,mBAAmB,uBA6B9B"}
@@ -1,5 +0,0 @@
1
- export declare const createSmoothSvgPath: (points: [
2
- number,
3
- number
4
- ][]) => string | null;
5
- //# sourceMappingURL=smooth-path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smooth-path.d.ts","sourceRoot":"","sources":["../src/smooth-path.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAY;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,kBA6B7D,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSmoothSvgPath = void 0;
4
- const createSmoothSvgPath = (points) => {
5
- return points.reduce((acc, point, i, a) => {
6
- if (i === 0) {
7
- return `M ${point[0]},${point[1]}`;
8
- }
9
- const p0 = a[i - 2] || a[i - 1];
10
- const x0 = p0[0];
11
- const y0 = p0[1];
12
- const p1 = a[i - 1];
13
- const x1 = p1[0];
14
- const y1 = p1[1];
15
- const x = point[0];
16
- const y = point[1];
17
- const cp1x = (2 * x0 + x1) / 3;
18
- const cp1y = (2 * y0 + y1) / 3;
19
- const cp2x = (x0 + 2 * x1) / 3;
20
- const cp2y = (y0 + 2 * y1) / 3;
21
- const cp3x = (x0 + 4 * x1 + x) / 6;
22
- const cp3y = (y0 + 4 * y1 + y) / 6;
23
- if (i === a.length - 1) {
24
- return `${acc} C ${cp1x},${cp1y} ${cp2x},${cp2y} ${cp3x},${cp3y} C${x},${y} ${x},${y} ${x},${y}`;
25
- }
26
- return `${acc} C ${cp1x},${cp1y} ${cp2x},${cp2y} ${cp3x},${cp3y}`;
27
- }, '');
28
- };
29
- exports.createSmoothSvgPath = createSmoothSvgPath;
30
- //# sourceMappingURL=smooth-path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smooth-path.js","sourceRoot":"","sources":["../src/smooth-path.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,CAAC,MAA0B,EAAE,EAAE;IACjE,OAAO,MAAM,CAAC,MAAM,CACnB,CAAC,GAAkB,EAAE,KAAuB,EAAE,CAAS,EAAE,CAAC,EAAE,EAAE;QAC7D,IAAI,CAAC,KAAK,CAAC,EAAE;YACZ,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACnC;QAED,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,OAAO,GAAG,GAAG,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACjG;QAED,OAAO,GAAG,GAAG,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;IACnE,CAAC,EACD,EAAE,CACF,CAAC;AACH,CAAC,CAAC;AA7BW,QAAA,mBAAmB,uBA6B9B"}
@@ -1,3 +0,0 @@
1
- import { AudioData } from './types';
2
- export declare const useAudioData: (src: string) => AudioData | null;
3
- //# sourceMappingURL=use-audio-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-audio-metadata.d.ts","sourceRoot":"","sources":["../src/use-audio-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,SAAS,GAAG,IAkCtD,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useAudioData = void 0;
4
- const react_1 = require("react");
5
- const remotion_1 = require("remotion");
6
- const get_audio_data_1 = require("./get-audio-data");
7
- const useAudioData = (src) => {
8
- if (!src) {
9
- throw new TypeError("useAudioMetadata requires a 'src' parameter");
10
- }
11
- const mountState = (0, react_1.useRef)({ isMounted: true });
12
- (0, react_1.useEffect)(() => {
13
- const { current } = mountState;
14
- current.isMounted = true;
15
- return () => {
16
- current.isMounted = false;
17
- };
18
- }, []);
19
- const [metadata, setMetadata] = (0, react_1.useState)(null);
20
- const fetchMetadata = (0, react_1.useCallback)(async () => {
21
- const handle = (0, remotion_1.delayRender)(`Waiting for audio metadata with src="${src}" to be loaded`);
22
- const data = await (0, get_audio_data_1.getAudioData)(src);
23
- if (mountState.current.isMounted) {
24
- setMetadata(data);
25
- }
26
- (0, remotion_1.continueRender)(handle);
27
- }, [src]);
28
- (0, react_1.useEffect)(() => {
29
- fetchMetadata();
30
- }, [fetchMetadata]);
31
- return metadata;
32
- };
33
- exports.useAudioData = useAudioData;
34
- //# sourceMappingURL=use-audio-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-audio-metadata.js","sourceRoot":"","sources":["../src/use-audio-metadata.ts"],"names":[],"mappings":";;;AAAA,iCAA+D;AAC/D,uCAAqD;AACrD,qDAA8C;AAGvC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAoB,EAAE;IAC7D,IAAI,CAAC,GAAG,EAAE;QACT,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;KACnE;IAED,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;IAE7C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,MAAM,EAAC,OAAO,EAAC,GAAG,UAAU,CAAC;QAC7B,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,OAAO,GAAG,EAAE;YACX,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAmB,IAAI,CAAC,CAAC;IAEjE,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC5C,MAAM,MAAM,GAAG,IAAA,sBAAW,EACzB,wCAAwC,GAAG,gBAAgB,CAC3D,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAC;QACrC,IAAI,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE;YACjC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClB;QAED,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,aAAa,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAlCW,QAAA,YAAY,gBAkCvB"}
@@ -1,11 +0,0 @@
1
- import { AudioData } from './types';
2
- declare type FnParameters = {
3
- audioData: AudioData;
4
- frame: number;
5
- fps: number;
6
- windowInSeconds: number;
7
- numberOfSamples: number;
8
- };
9
- export declare const visualizeAudioWaveform: ({ ...parameters }: FnParameters) => number[];
10
- export {};
11
- //# sourceMappingURL=visualize-audio-waveform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visualize-audio-waveform.d.ts","sourceRoot":"","sources":["../src/visualize-audio-waveform.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAIlC,aAAK,YAAY,GAAG;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACxB,CAAC;AA2CF,eAAO,MAAM,sBAAsB,sBAAqB,YAAY,aAGnE,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visualizeAudioWaveform = void 0;
4
- const get_waveform_portion_1 = require("./get-waveform-portion");
5
- const cache = {};
6
- const visualizeAudioWaveformFrame = ({ audioData, frame, fps, numberOfSamples, windowInSeconds, }) => {
7
- if (windowInSeconds * audioData.sampleRate < numberOfSamples) {
8
- throw new TypeError(windowInSeconds +
9
- 's audiodata does not have ' +
10
- numberOfSamples +
11
- ' bars. Increase windowInSeconds or decrease numberOfSamples');
12
- }
13
- const cacheKey = audioData.resultId + frame + fps + numberOfSamples + 'waveform';
14
- if (cache[cacheKey]) {
15
- return cache[cacheKey];
16
- }
17
- const time = frame / fps;
18
- const max = audioData.durationInSeconds - windowInSeconds / 2;
19
- const min = windowInSeconds / 2;
20
- const startTimeInSeconds = Math.min(max, Math.max(min, time - windowInSeconds / 2));
21
- return (0, get_waveform_portion_1.getWaveformPortion)({
22
- audioData,
23
- startTimeInSeconds,
24
- durationInSeconds: windowInSeconds,
25
- numberOfSamples,
26
- normalize: true,
27
- });
28
- };
29
- const visualizeAudioWaveform = ({ ...parameters }) => {
30
- const data = visualizeAudioWaveformFrame(parameters);
31
- return data.map((value) => value.amplitude);
32
- };
33
- exports.visualizeAudioWaveform = visualizeAudioWaveform;
34
- //# sourceMappingURL=visualize-audio-waveform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visualize-audio-waveform.js","sourceRoot":"","sources":["../src/visualize-audio-waveform.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAG/D,MAAM,KAAK,GAA2B,EAAE,CAAC;AAUzC,MAAM,2BAA2B,GAAG,CAAC,EACpC,SAAS,EACT,KAAK,EACL,GAAG,EACH,eAAe,EACf,eAAe,GACD,EAAE,EAAE;IAClB,IAAI,eAAe,GAAG,SAAS,CAAC,UAAU,GAAG,eAAe,EAAE;QAC7D,MAAM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