@remotion/studio 4.0.278 → 4.0.280
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/.turbo/turbo-make.log +2 -2
- package/dist/components/AudioWaveform.js +4 -3
- package/dist/components/AudioWaveformBar.d.ts +10 -2
- package/dist/components/AudioWaveformBar.js +13 -4
- package/dist/esm/internals.mjs +9 -8
- package/dist/esm/previewEntry.mjs +9 -8
- package/dist/esm/renderEntry.mjs +8 -7
- package/package.json +12 -12
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-make.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @remotion/studio@4.0.
|
|
3
|
+
> @remotion/studio@4.0.280 make /Users/jonathanburger/remotion/packages/studio
|
|
4
4
|
> tsc -d && bun --env-file=../.env.bundle bundle.ts
|
|
5
5
|
|
|
6
|
-
[0m[2m[[
|
|
6
|
+
[0m[2m[[1m45.22ms[0m[2m][0m Generated.
|
|
@@ -11,7 +11,7 @@ const AudioWaveformBar_1 = require("./AudioWaveformBar");
|
|
|
11
11
|
const container = {
|
|
12
12
|
display: 'flex',
|
|
13
13
|
flexDirection: 'row',
|
|
14
|
-
alignItems: '
|
|
14
|
+
alignItems: 'flex-end',
|
|
15
15
|
position: 'absolute',
|
|
16
16
|
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT,
|
|
17
17
|
};
|
|
@@ -98,8 +98,9 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, s
|
|
|
98
98
|
return (0, media_utils_1.getWaveformPortion)({
|
|
99
99
|
audioData: metadata,
|
|
100
100
|
startTimeInSeconds: startFrom / vidConf.fps,
|
|
101
|
-
durationInSeconds: (durationInFrames / vidConf.fps) * playbackRate,
|
|
101
|
+
durationInSeconds: Math.min((durationInFrames / vidConf.fps) * playbackRate, metadata.durationInSeconds),
|
|
102
102
|
numberOfSamples,
|
|
103
|
+
normalize: false,
|
|
103
104
|
});
|
|
104
105
|
}, [
|
|
105
106
|
durationInFrames,
|
|
@@ -116,7 +117,7 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, s
|
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
118
119
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [normalized.map((w) => {
|
|
119
|
-
return (0, jsx_runtime_1.jsx)(AudioWaveformBar_1.AudioWaveformBar, { amplitude: w.amplitude }, w.index);
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(AudioWaveformBar_1.AudioWaveformBar, { amplitude: w.amplitude * (typeof volume === 'number' ? volume : 1) }, w.index));
|
|
120
121
|
}), (0, jsx_runtime_1.jsx)("canvas", { ref: canvas, style: canvasStyle, width: visualizationWidth, height: timeline_layout_1.TIMELINE_LAYER_HEIGHT })] }));
|
|
121
122
|
};
|
|
122
123
|
exports.AudioWaveform = AudioWaveform;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const WAVEFORM_BAR_LENGTH =
|
|
3
|
-
export declare const WAVEFORM_BAR_MARGIN =
|
|
2
|
+
export declare const WAVEFORM_BAR_LENGTH = 2;
|
|
3
|
+
export declare const WAVEFORM_BAR_MARGIN = 1;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* consider a sinus wave with an amplitude going from [-1, 1].
|
|
7
|
+
* if we sample it infinitely, and convert all negative samples from negative to positive
|
|
8
|
+
* what is the average of all samples?
|
|
9
|
+
*
|
|
10
|
+
* Answer: 2 / Math.PI = 0.6366
|
|
11
|
+
*/
|
|
4
12
|
export declare const AudioWaveformBar: React.FC<{
|
|
5
13
|
readonly amplitude: number;
|
|
6
14
|
}>;
|
|
@@ -4,19 +4,28 @@ exports.AudioWaveformBar = exports.WAVEFORM_BAR_MARGIN = exports.WAVEFORM_BAR_LE
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
7
|
-
exports.WAVEFORM_BAR_LENGTH =
|
|
8
|
-
exports.WAVEFORM_BAR_MARGIN =
|
|
7
|
+
exports.WAVEFORM_BAR_LENGTH = 2;
|
|
8
|
+
exports.WAVEFORM_BAR_MARGIN = 1;
|
|
9
9
|
const container = {
|
|
10
10
|
width: exports.WAVEFORM_BAR_LENGTH,
|
|
11
|
-
backgroundColor: 'rgba(255, 255, 255, 0.
|
|
11
|
+
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
12
12
|
marginLeft: exports.WAVEFORM_BAR_MARGIN,
|
|
13
13
|
borderRadius: 2,
|
|
14
14
|
};
|
|
15
|
+
// Sonnet:
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* consider a sinus wave with an amplitude going from [-1, 1].
|
|
19
|
+
* if we sample it infinitely, and convert all negative samples from negative to positive
|
|
20
|
+
* what is the average of all samples?
|
|
21
|
+
*
|
|
22
|
+
* Answer: 2 / Math.PI = 0.6366
|
|
23
|
+
*/
|
|
15
24
|
const AudioWaveformBar = ({ amplitude }) => {
|
|
16
25
|
const style = (0, react_1.useMemo)(() => {
|
|
17
26
|
return {
|
|
18
27
|
...container,
|
|
19
|
-
height:
|
|
28
|
+
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT * amplitude * (1 / 0.6366),
|
|
20
29
|
};
|
|
21
30
|
}, [amplitude]);
|
|
22
31
|
return (0, jsx_runtime_1.jsx)("div", { style: style });
|
package/dist/esm/internals.mjs
CHANGED
|
@@ -19248,11 +19248,11 @@ import { Internals as Internals49 } from "remotion";
|
|
|
19248
19248
|
// src/components/AudioWaveformBar.tsx
|
|
19249
19249
|
import { useMemo as useMemo100 } from "react";
|
|
19250
19250
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
19251
|
-
var WAVEFORM_BAR_LENGTH =
|
|
19252
|
-
var WAVEFORM_BAR_MARGIN =
|
|
19251
|
+
var WAVEFORM_BAR_LENGTH = 2;
|
|
19252
|
+
var WAVEFORM_BAR_MARGIN = 1;
|
|
19253
19253
|
var container38 = {
|
|
19254
19254
|
width: WAVEFORM_BAR_LENGTH,
|
|
19255
|
-
backgroundColor: "rgba(255, 255, 255, 0.
|
|
19255
|
+
backgroundColor: "rgba(255, 255, 255, 0.6)",
|
|
19256
19256
|
marginLeft: WAVEFORM_BAR_MARGIN,
|
|
19257
19257
|
borderRadius: 2
|
|
19258
19258
|
};
|
|
@@ -19260,7 +19260,7 @@ var AudioWaveformBar = ({ amplitude }) => {
|
|
|
19260
19260
|
const style11 = useMemo100(() => {
|
|
19261
19261
|
return {
|
|
19262
19262
|
...container38,
|
|
19263
|
-
height: TIMELINE_LAYER_HEIGHT
|
|
19263
|
+
height: TIMELINE_LAYER_HEIGHT * amplitude * (1 / 0.6366)
|
|
19264
19264
|
};
|
|
19265
19265
|
}, [amplitude]);
|
|
19266
19266
|
return /* @__PURE__ */ jsx182("div", {
|
|
@@ -19273,7 +19273,7 @@ import { jsx as jsx183, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
|
19273
19273
|
var container39 = {
|
|
19274
19274
|
display: "flex",
|
|
19275
19275
|
flexDirection: "row",
|
|
19276
|
-
alignItems: "
|
|
19276
|
+
alignItems: "flex-end",
|
|
19277
19277
|
position: "absolute",
|
|
19278
19278
|
height: TIMELINE_LAYER_HEIGHT
|
|
19279
19279
|
};
|
|
@@ -19363,8 +19363,9 @@ var AudioWaveform = ({
|
|
|
19363
19363
|
return getWaveformPortion({
|
|
19364
19364
|
audioData: metadata,
|
|
19365
19365
|
startTimeInSeconds: startFrom / vidConf.fps,
|
|
19366
|
-
durationInSeconds: durationInFrames / vidConf.fps * playbackRate,
|
|
19367
|
-
numberOfSamples
|
|
19366
|
+
durationInSeconds: Math.min(durationInFrames / vidConf.fps * playbackRate, metadata.durationInSeconds),
|
|
19367
|
+
numberOfSamples,
|
|
19368
|
+
normalize: false
|
|
19368
19369
|
});
|
|
19369
19370
|
}, [
|
|
19370
19371
|
durationInFrames,
|
|
@@ -19391,7 +19392,7 @@ var AudioWaveform = ({
|
|
|
19391
19392
|
children: [
|
|
19392
19393
|
normalized.map((w) => {
|
|
19393
19394
|
return /* @__PURE__ */ jsx183(AudioWaveformBar, {
|
|
19394
|
-
amplitude: w.amplitude
|
|
19395
|
+
amplitude: w.amplitude * (typeof volume === "number" ? volume : 1)
|
|
19395
19396
|
}, w.index);
|
|
19396
19397
|
}),
|
|
19397
19398
|
/* @__PURE__ */ jsx183("canvas", {
|
|
@@ -19530,11 +19530,11 @@ import { Internals as Internals49 } from "remotion";
|
|
|
19530
19530
|
// src/components/AudioWaveformBar.tsx
|
|
19531
19531
|
import { useMemo as useMemo100 } from "react";
|
|
19532
19532
|
import { jsx as jsx183 } from "react/jsx-runtime";
|
|
19533
|
-
var WAVEFORM_BAR_LENGTH =
|
|
19534
|
-
var WAVEFORM_BAR_MARGIN =
|
|
19533
|
+
var WAVEFORM_BAR_LENGTH = 2;
|
|
19534
|
+
var WAVEFORM_BAR_MARGIN = 1;
|
|
19535
19535
|
var container38 = {
|
|
19536
19536
|
width: WAVEFORM_BAR_LENGTH,
|
|
19537
|
-
backgroundColor: "rgba(255, 255, 255, 0.
|
|
19537
|
+
backgroundColor: "rgba(255, 255, 255, 0.6)",
|
|
19538
19538
|
marginLeft: WAVEFORM_BAR_MARGIN,
|
|
19539
19539
|
borderRadius: 2
|
|
19540
19540
|
};
|
|
@@ -19542,7 +19542,7 @@ var AudioWaveformBar = ({ amplitude }) => {
|
|
|
19542
19542
|
const style11 = useMemo100(() => {
|
|
19543
19543
|
return {
|
|
19544
19544
|
...container38,
|
|
19545
|
-
height: TIMELINE_LAYER_HEIGHT
|
|
19545
|
+
height: TIMELINE_LAYER_HEIGHT * amplitude * (1 / 0.6366)
|
|
19546
19546
|
};
|
|
19547
19547
|
}, [amplitude]);
|
|
19548
19548
|
return /* @__PURE__ */ jsx183("div", {
|
|
@@ -19555,7 +19555,7 @@ import { jsx as jsx184, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
|
19555
19555
|
var container39 = {
|
|
19556
19556
|
display: "flex",
|
|
19557
19557
|
flexDirection: "row",
|
|
19558
|
-
alignItems: "
|
|
19558
|
+
alignItems: "flex-end",
|
|
19559
19559
|
position: "absolute",
|
|
19560
19560
|
height: TIMELINE_LAYER_HEIGHT
|
|
19561
19561
|
};
|
|
@@ -19645,8 +19645,9 @@ var AudioWaveform = ({
|
|
|
19645
19645
|
return getWaveformPortion({
|
|
19646
19646
|
audioData: metadata,
|
|
19647
19647
|
startTimeInSeconds: startFrom / vidConf.fps,
|
|
19648
|
-
durationInSeconds: durationInFrames / vidConf.fps * playbackRate,
|
|
19649
|
-
numberOfSamples
|
|
19648
|
+
durationInSeconds: Math.min(durationInFrames / vidConf.fps * playbackRate, metadata.durationInSeconds),
|
|
19649
|
+
numberOfSamples,
|
|
19650
|
+
normalize: false
|
|
19650
19651
|
});
|
|
19651
19652
|
}, [
|
|
19652
19653
|
durationInFrames,
|
|
@@ -19673,7 +19674,7 @@ var AudioWaveform = ({
|
|
|
19673
19674
|
children: [
|
|
19674
19675
|
normalized.map((w) => {
|
|
19675
19676
|
return /* @__PURE__ */ jsx184(AudioWaveformBar, {
|
|
19676
|
-
amplitude: w.amplitude
|
|
19677
|
+
amplitude: w.amplitude * (typeof volume === "number" ? volume : 1)
|
|
19677
19678
|
}, w.index);
|
|
19678
19679
|
}),
|
|
19679
19680
|
/* @__PURE__ */ jsx184("canvas", {
|
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -19894,11 +19894,11 @@ var init_get_timeline_sequence_layout = () => {
|
|
|
19894
19894
|
// src/components/AudioWaveformBar.tsx
|
|
19895
19895
|
import { useMemo as useMemo100 } from "react";
|
|
19896
19896
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
19897
|
-
var WAVEFORM_BAR_LENGTH =
|
|
19897
|
+
var WAVEFORM_BAR_LENGTH = 2, WAVEFORM_BAR_MARGIN = 1, container38, AudioWaveformBar = ({ amplitude }) => {
|
|
19898
19898
|
const style11 = useMemo100(() => {
|
|
19899
19899
|
return {
|
|
19900
19900
|
...container38,
|
|
19901
|
-
height: TIMELINE_LAYER_HEIGHT
|
|
19901
|
+
height: TIMELINE_LAYER_HEIGHT * amplitude * (1 / 0.6366)
|
|
19902
19902
|
};
|
|
19903
19903
|
}, [amplitude]);
|
|
19904
19904
|
return /* @__PURE__ */ jsx182("div", {
|
|
@@ -19908,7 +19908,7 @@ var WAVEFORM_BAR_LENGTH = 4, WAVEFORM_BAR_MARGIN = 2, container38, AudioWaveform
|
|
|
19908
19908
|
var init_AudioWaveformBar = __esm(() => {
|
|
19909
19909
|
container38 = {
|
|
19910
19910
|
width: WAVEFORM_BAR_LENGTH,
|
|
19911
|
-
backgroundColor: "rgba(255, 255, 255, 0.
|
|
19911
|
+
backgroundColor: "rgba(255, 255, 255, 0.6)",
|
|
19912
19912
|
marginLeft: WAVEFORM_BAR_MARGIN,
|
|
19913
19913
|
borderRadius: 2
|
|
19914
19914
|
};
|
|
@@ -19992,8 +19992,9 @@ var container39, errorMessage, canvasStyle, AudioWaveform = ({
|
|
|
19992
19992
|
return getWaveformPortion({
|
|
19993
19993
|
audioData: metadata,
|
|
19994
19994
|
startTimeInSeconds: startFrom / vidConf.fps,
|
|
19995
|
-
durationInSeconds: durationInFrames / vidConf.fps * playbackRate,
|
|
19996
|
-
numberOfSamples
|
|
19995
|
+
durationInSeconds: Math.min(durationInFrames / vidConf.fps * playbackRate, metadata.durationInSeconds),
|
|
19996
|
+
numberOfSamples,
|
|
19997
|
+
normalize: false
|
|
19997
19998
|
});
|
|
19998
19999
|
}, [
|
|
19999
20000
|
durationInFrames,
|
|
@@ -20020,7 +20021,7 @@ var container39, errorMessage, canvasStyle, AudioWaveform = ({
|
|
|
20020
20021
|
children: [
|
|
20021
20022
|
normalized.map((w) => {
|
|
20022
20023
|
return /* @__PURE__ */ jsx183(AudioWaveformBar, {
|
|
20023
|
-
amplitude: w.amplitude
|
|
20024
|
+
amplitude: w.amplitude * (typeof volume === "number" ? volume : 1)
|
|
20024
20025
|
}, w.index);
|
|
20025
20026
|
}),
|
|
20026
20027
|
/* @__PURE__ */ jsx183("canvas", {
|
|
@@ -20037,7 +20038,7 @@ var init_AudioWaveform = __esm(() => {
|
|
|
20037
20038
|
container39 = {
|
|
20038
20039
|
display: "flex",
|
|
20039
20040
|
flexDirection: "row",
|
|
20040
|
-
alignItems: "
|
|
20041
|
+
alignItems: "flex-end",
|
|
20041
20042
|
position: "absolute",
|
|
20042
20043
|
height: TIMELINE_LAYER_HEIGHT
|
|
20043
20044
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.280",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -23,20 +23,20 @@
|
|
|
23
23
|
"source-map": "0.7.3",
|
|
24
24
|
"open": "^8.4.2",
|
|
25
25
|
"zod": "3.22.3",
|
|
26
|
-
"remotion": "4.0.
|
|
27
|
-
"@remotion/player": "4.0.
|
|
28
|
-
"@remotion/media-utils": "4.0.
|
|
29
|
-
"@remotion/media-parser": "4.0.
|
|
30
|
-
"@remotion/renderer": "4.0.
|
|
31
|
-
"@remotion/studio-shared": "4.0.
|
|
32
|
-
"@remotion/zod-types": "4.0.
|
|
26
|
+
"remotion": "4.0.280",
|
|
27
|
+
"@remotion/player": "4.0.280",
|
|
28
|
+
"@remotion/media-utils": "4.0.280",
|
|
29
|
+
"@remotion/media-parser": "4.0.280",
|
|
30
|
+
"@remotion/renderer": "4.0.280",
|
|
31
|
+
"@remotion/studio-shared": "4.0.280",
|
|
32
|
+
"@remotion/zod-types": "4.0.280"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"react": "19.0.0",
|
|
36
36
|
"react-dom": "19.0.0",
|
|
37
37
|
"@types/semver": "^7.3.4",
|
|
38
38
|
"eslint": "9.19.0",
|
|
39
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
39
|
+
"@remotion/eslint-config-internal": "4.0.280"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"typesVersions": {
|
|
73
73
|
">=1.0": {
|
|
74
74
|
"renderEntry": [
|
|
75
|
-
"dist/renderEntry.d.ts"
|
|
75
|
+
"./dist/renderEntry.d.ts"
|
|
76
76
|
],
|
|
77
77
|
"internals": [
|
|
78
|
-
"dist/internals.d.ts"
|
|
78
|
+
"./dist/internals.d.ts"
|
|
79
79
|
],
|
|
80
80
|
"previewEntry": [
|
|
81
|
-
"dist/previewEntry.d.ts"
|
|
81
|
+
"./dist/previewEntry.d.ts"
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
},
|