@remotion/media-utils 4.0.243 → 4.0.245

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,5 +1 @@
1
- /**
2
- * @description This API takes an AudioBuffer instance and converts it to a Base 64 Data URL so it can be passed to an <Audio /> tag.
3
- * @see [Documentation](https://www.remotion.dev/docs/audio-buffer-to-data-url)
4
- */
5
1
  export declare const audioBufferToDataUrl: (buffer: AudioBuffer) => string;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.audioBufferToDataUrl = void 0;
4
4
  const audio_buffer_to_wav_1 = require("./audio-buffer-to-wav");
5
- /**
6
- * @description This API takes an AudioBuffer instance and converts it to a Base 64 Data URL so it can be passed to an <Audio /> tag.
7
- * @see [Documentation](https://www.remotion.dev/docs/audio-buffer-to-data-url)
5
+ /*
6
+ * @description Takes an AudioBuffer instance and converts it to a Base 64 Data URL so it can be passed to an <Audio /> tag.
7
+ * @see [Documentation](https://remotion.dev/docs/audio-buffer-to-data-url)
8
8
  */
9
9
  const audioBufferToDataUrl = (buffer) => {
10
10
  const wavAsArrayBuffer = (0, audio_buffer_to_wav_1.audioBufferToWav)(buffer, {
@@ -2,9 +2,5 @@ import type { AudioData } from './types';
2
2
  type Options = {
3
3
  sampleRate?: number;
4
4
  };
5
- /**
6
- * @description Takes an audio src, loads it and returns data and metadata for the specified source.
7
- * @see [Documentation](https://www.remotion.dev/docs/get-audio-data)
8
- */
9
5
  export declare const getAudioData: (src: string, options?: Options) => Promise<AudioData>;
10
6
  export {};
@@ -36,9 +36,9 @@ const fn = async (src, options) => {
36
36
  metadataCache[src] = metadata;
37
37
  return metadata;
38
38
  };
39
- /**
39
+ /*
40
40
  * @description Takes an audio src, loads it and returns data and metadata for the specified source.
41
- * @see [Documentation](https://www.remotion.dev/docs/get-audio-data)
41
+ * @see [Documentation](https://remotion.dev/docs/get-audio-data)
42
42
  */
43
43
  const getAudioData = (src, options) => {
44
44
  return limit(fn, src, options);
@@ -1,10 +1,3 @@
1
- /**
2
- * @default Get the audio file passed in parameter duration in seconds
3
- * @async
4
- * @param src path to the audio file
5
- * @return {number} duration of the audio file in seconds
6
- * @see [Documentation](https://www.remotion.dev/docs/get-audio-duration-in-seconds)
7
- */
8
1
  export declare const getAudioDurationInSeconds: (src: string) => Promise<number>;
9
2
  /**
10
3
  * @deprecated Renamed to `getAudioDurationInSeconds`
@@ -39,12 +39,9 @@ const fn = (src) => {
39
39
  audio.addEventListener('error', onError, { once: true });
40
40
  });
41
41
  };
42
- /**
43
- * @default Get the audio file passed in parameter duration in seconds
44
- * @async
45
- * @param src path to the audio file
46
- * @return {number} duration of the audio file in seconds
47
- * @see [Documentation](https://www.remotion.dev/docs/get-audio-duration-in-seconds)
42
+ /*
43
+ * @description Gets the duration in seconds of an audio source by creating an invisible `<audio>` tag, loading the audio, and returning the duration.
44
+ * @see [Documentation](https://remotion.dev/docs/get-audio-duration-in-seconds)
48
45
  */
49
46
  const getAudioDurationInSeconds = (src) => {
50
47
  return limit(fn, src);
@@ -1,6 +1,2 @@
1
1
  import type { ImageDimensions } from './types';
2
- /**
3
- * @description Takes an image src, retrieves the dimensions of an image.
4
- * @see [Documentation](https://www.remotion.dev/docs/get-image-dimensions)
5
- */
6
2
  export declare function getImageDimensions(src: string): Promise<ImageDimensions>;
@@ -23,9 +23,9 @@ const fn = async (src) => {
23
23
  imageDimensionsCache[src] = imageDimensions;
24
24
  return imageDimensions;
25
25
  };
26
- /**
26
+ /*
27
27
  * @description Takes an image src, retrieves the dimensions of an image.
28
- * @see [Documentation](https://www.remotion.dev/docs/get-image-dimensions)
28
+ * @see [Documentation](https://remotion.dev/docs/get-image-dimensions)
29
29
  */
30
30
  function getImageDimensions(src) {
31
31
  return limit(fn, src);
@@ -1,6 +1,2 @@
1
1
  import type { VideoMetadata } from './types';
2
- /**
3
- * @description Takes a src to a video, loads it and returns metadata for the specified source.
4
- * @see [Documentation](https://www.remotion.dev/docs/get-video-metadata)
5
- */
6
2
  export declare const getVideoMetadata: (src: string) => Promise<VideoMetadata>;
@@ -56,9 +56,9 @@ const fn = (src) => {
56
56
  video.addEventListener('error', onError, { once: true });
57
57
  });
58
58
  };
59
- /**
59
+ /*
60
60
  * @description Takes a src to a video, loads it and returns metadata for the specified source.
61
- * @see [Documentation](https://www.remotion.dev/docs/get-video-metadata)
61
+ * @see [Documentation](https://remotion.dev/docs/get-video-metadata)
62
62
  */
63
63
  const getVideoMetadata = (src) => {
64
64
  return limit(fn, src);
@@ -3,10 +3,6 @@ type Bar = {
3
3
  index: number;
4
4
  amplitude: number;
5
5
  };
6
- /**
7
- * @description Takes bulky waveform data (for example fetched by getAudioData()) and returns a trimmed and simplified version of it, for simpler visualization
8
- * @see [Documentation](https://www.remotion.dev/docs/get-waveform-portion)
9
- */
10
6
  export declare const getWaveformPortion: ({ audioData, startTimeInSeconds, durationInSeconds, numberOfSamples, }: {
11
7
  audioData: AudioData;
12
8
  startTimeInSeconds: number;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWaveformPortion = void 0;
4
4
  const get_wave_form_samples_1 = require("./get-wave-form-samples");
5
- /**
5
+ /*
6
6
  * @description Takes bulky waveform data (for example fetched by getAudioData()) and returns a trimmed and simplified version of it, for simpler visualization
7
- * @see [Documentation](https://www.remotion.dev/docs/get-waveform-portion)
7
+ * @see [Documentation](https://remotion.dev/docs/get-waveform-portion)
8
8
  */
9
9
  const getWaveformPortion = ({ audioData, startTimeInSeconds, durationInSeconds, numberOfSamples, }) => {
10
10
  const startSample = Math.floor((startTimeInSeconds / audioData.durationInSeconds) *
@@ -1,9 +1,2 @@
1
1
  import type { AudioData } from './types';
2
- /**
3
- * @description Wraps the getAudioData() function into a hook and does 3 things:
4
- * @description Keeps the audio data in a state
5
- * @description Wraps the function in a delayRender() / continueRender() pattern.
6
- * @description Handles the case where the component gets unmounted while the fetching is in progress and a React error is thrown.
7
- * @see [Documentation](https://www.remotion.dev/docs/use-audio-data)
8
- */
9
2
  export declare const useAudioData: (src: string) => AudioData | null;
@@ -4,11 +4,8 @@ exports.useAudioData = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const get_audio_data_1 = require("./get-audio-data");
7
- /**
8
- * @description Wraps the getAudioData() function into a hook and does 3 things:
9
- * @description Keeps the audio data in a state
10
- * @description Wraps the function in a delayRender() / continueRender() pattern.
11
- * @description Handles the case where the component gets unmounted while the fetching is in progress and a React error is thrown.
7
+ /*
8
+ * @description Wraps the getAudioData() function into a hook and does three things: keeps the audio data in a state, wraps the function in a delayRender() / continueRender() pattern, and handles the case where the component gets unmounted while fetching is in progress to prevent React errors.
12
9
  * @see [Documentation](https://www.remotion.dev/docs/use-audio-data)
13
10
  */
14
11
  const useAudioData = (src) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/media-utils"
4
4
  },
5
5
  "name": "@remotion/media-utils",
6
- "version": "4.0.243",
6
+ "version": "4.0.245",
7
7
  "description": "Utilities for working with media files",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/remotion-dev/remotion/issues"
14
14
  },
15
15
  "dependencies": {
16
- "remotion": "4.0.243"
16
+ "remotion": "4.0.245"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "eslint": "9.14.0",
24
- "@remotion/eslint-config-internal": "4.0.243"
24
+ "@remotion/eslint-config-internal": "4.0.245"
25
25
  },
26
26
  "keywords": [
27
27
  "remotion",