File size: 991 Bytes
6167061 8a4825d 2de6bc4 8a4825d 6167061 7191cf4 8a4825d 2af4084 8a4825d 2af4084 fb42803 2af4084 8a4825d 6167061 8a4825d 7191cf4 fb42803 0f248e4 fb42803 7191cf4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import {Series} from 'remotion';
import React from 'react';
import {staticFile, useVideoConfig, Audio} from 'remotion';
import audioSequences from './Assets/AudioSequences.json';
import {TransitionSeries} from '@remotion/transitions';
const AudioStream = React.memo(() => {
const {fps} = useVideoConfig();
return (
<TransitionSeries
style={{
color: 'white',
position: 'absolute',
zIndex: 0,
}}
>
{audioSequences.map((entry, index) => {
return (
<TransitionSeries.Sequence
key={index}
from={fps * entry.start}
durationInFrames={fps * (entry.end - entry.start)}
>
<AudioX entry={entry} />
</TransitionSeries.Sequence>
);
})}
</TransitionSeries>
);
});
const AudioX = React.memo(({entry}) => {
return (
<Audio
{...entry.props}
// startFrom={entry.props.startFrom}
// endAt={entry.props.endAt}
// volume={entry.props.volume}
src={staticFile(entry.name)}
/>
);
});
export default AudioStream;
|