Skip to main content

Audio

The <Audio> component is a drop-in replacement for the <audio> tag. This is how you insert audio into Liqvid videos, ensuring that the audio will be synced up to the video playback. The syntax is:

import {Audio} from "liqvid";
<Audio start={0}>  <source src={`audio.webm`} type="audio/webm"/>  <source src={`audio.mp4`} type="audio/mp4"/></Audio>

start is a number indicating when the audio should start playing. Any additional props or children will be forwarded to the underlying <audio> element.

Props#

start#

Time in milliseconds when the video should start playing.

start: number;

Web Autoplay Policy#

When recording, it can be helpful to record several segments individually. Then you can use several <Audio> elements with different start attributes. However, due to the Web Autoplay Policy, the final recording must be joined into a single file. See https://trac.ffmpeg.org/wiki/Concatenate#demuxer