Skip to main content

Audio

The Audio config allows you to adjust the audio of your layer by specifying the volume attribute.

Interface

interface Audio {
audio?: {
// number between 0 (muted) and 1 (full volume)
// defaults to 1
volume?: number;
};
}

Configuring Audio

You can modify a layer's audio-related settings by passing a configuration object or by calling its setters. You can read the layer's audio-related settings by calling its getters

Configuration Object

await composition.addVideo(
"https://docs.editframe.com/layer-configuration/audio/wind-chimes.mp4",
{
audio: {
volume: 0.1,
},
}
);

Output

Setters

setVolume

const video = await composition.addVideo(
"https://docs.editframe.com/layer-configuration/audio/wind-chimes.mp4"
);

video.setVolume(0.1);

Output

setMuted

const video = await composition.addVideo(
"https://docs.editframe.com/layer-configuration/audio/wind-chimes.mp4"
);

video.setMuted();

Output

Getters

video.volume; // -> 0.5