Skip to main content

createSmoothSvgPath()

@remotion/media-utils 包辅助函数的一部分。

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

此函数接受点,通常由 visualizeAudioWaveform()visualizeAudio() 生成,并在它们之间添加 SVG C(曲线)语句以创建平滑的路径。

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

示例

🌐 Example

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