Download Remotion-app/src/HelloWorld/AudioStream.jsx from azils3/Rectif: direct link, hf CLI and curl.
- Browser
- Download file 928 Bytes
-
https://huggingface.co/spaces/azils3/Rectif/resolve/main/Remotion-app/src/HelloWorld/AudioStream.jsx
- Command line
-
hf download hf://spaces/azils3/Rectif/Remotion-app/src/HelloWorld/AudioStream.jsx
-
curl -L -o AudioStream.jsx https://huggingface.co/spaces/azils3/Rectif/resolve/main/Remotion-app/src/HelloWorld/AudioStream.jsx
928 Bytes
| import {Series} from 'remotion'; | |
| import React, {useMemo} 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(); | |
| const audioComponents = useMemo(() => { | |
| return audioSequences.map((entry, index) => ( | |
| <TransitionSeries.Sequence | |
| key={index} | |
| from={fps * entry.start} | |
| durationInFrames={fps * (entry.end - entry.start)} | |
| > | |
| <AudioX entry={entry} /> | |
| </TransitionSeries.Sequence> | |
| )); | |
| }, [fps]); | |
| return ( | |
| <TransitionSeries | |
| style={{ | |
| color: 'white', | |
| position: 'absolute', | |
| zIndex: 0, | |
| }} | |
| > | |
| {audioComponents} | |
| </TransitionSeries> | |
| ); | |
| }); | |
| const AudioX = React.memo(({entry}) => { | |
| return <Audio {...entry.props} src={staticFile(entry.name)} />; | |
| }); | |
| export default AudioStream; | |