added sfx
Browse files
Remotion-app/src/HelloWorld/SfxStream.jsx
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {Series} from 'remotion';
|
2 |
+
import React from 'react';
|
3 |
+
import {staticFile, useVideoConfig, Audio} from 'remotion';
|
4 |
+
import sfxSequences from './Assets/SfxSequences.json';
|
5 |
+
import {TransitionSeries} from '@remotion/transitions';
|
6 |
+
export default function SfxStream() {
|
7 |
+
const {fps} = useVideoConfig();
|
8 |
+
return (
|
9 |
+
<TransitionSeries>
|
10 |
+
{sfxSequences.map((entry, index) => {
|
11 |
+
return (
|
12 |
+
<TransitionSeries.Sequence
|
13 |
+
key={index}
|
14 |
+
from={fps * entry.start}
|
15 |
+
durationInFrames={fps * (entry.end - entry.start)}
|
16 |
+
>
|
17 |
+
<Audio
|
18 |
+
endAt={entry.props.endAt}
|
19 |
+
startFrom={entry.props.startFrom}
|
20 |
+
src={staticFile(entry.name)}
|
21 |
+
/>
|
22 |
+
</TransitionSeries.Sequence>
|
23 |
+
);
|
24 |
+
})}
|
25 |
+
</TransitionSeries>
|
26 |
+
);
|
27 |
+
}
|
Remotion-app/src/HelloWorld/index.jsx
CHANGED
@@ -4,10 +4,12 @@ import {TextStream} from './TextStream';
|
|
4 |
|
5 |
import AudioStream from './AudioStream';
|
6 |
import ImageStream from './ImageStream';
|
|
|
7 |
|
8 |
export const HelloWorld = () => {
|
9 |
return (
|
10 |
<AbsoluteFill style={{position: 'relative', backgroundColor: 'black'}}>
|
|
|
11 |
<ImageStream />
|
12 |
<TextStream />
|
13 |
<VideoStream />
|
|
|
4 |
|
5 |
import AudioStream from './AudioStream';
|
6 |
import ImageStream from './ImageStream';
|
7 |
+
import SfxStream from './SfxStream';
|
8 |
|
9 |
export const HelloWorld = () => {
|
10 |
return (
|
11 |
<AbsoluteFill style={{position: 'relative', backgroundColor: 'black'}}>
|
12 |
+
<SfxStream />
|
13 |
<ImageStream />
|
14 |
<TextStream />
|
15 |
<VideoStream />
|