tnfe / FFCreator

A fast video processing library based on node.js (一个基于node.js的高速视频制作库)
http://tnfe.github.io/FFCreator/
MIT License
2.82k stars 398 forks source link

Waveform question #137

Open armandolio opened 2 years ago

armandolio commented 2 years ago

Hello everybody! it is possible to create with FFCreator a waveform from the audio source?

Thanks! Armando

drawcall commented 2 years ago

Use FFExtras to draw curves. Use https://github.com/phding/waveform-node to parse audio waves.

const extras = new FFExtras();

extras.init = function (InkPaint) {
  const graphic = new InkPaint.Graphics();
  this.container.addChild(graphic);
  this.graphic = graphic;
};

extras.update = function (time) {
  this.graphic.clear();
  this.graphic.lineStyle(2, 0xff0000);
  this.graphic.lineTo(...);
  ...
  this.graphic.closePath();
};