Back to Remotion

createSmoothSvgPath()

packages/docs/docs/media-utils/create-smooth-svg-path.mdx

4.0.466863 B
Original Source

Part of the @remotion/media-utils package of helper functions.

This function takes points, usually generated from visualizeAudioWaveform() or visualizeAudio(), and adds SVG C (curve) statements inbetween them to create a smooth path.

Example

tsx
import {createSmoothSvgPath} from '@remotion/media-utils';
import React from 'react';

const points = [
  {x: 0, y: 0},
  {x: 100, y: 100},
  {x: 200, y: 50},
  {x: 300, y: 150},
];

const path = createSmoothSvgPath({points});

See a practical example here.

See also