Start
//

How To: Connect Waveform to Audio or Video

Problem: You want to visualize audio from an audio or video element with a waveform.

Solution: Use the target attribute on the waveform element, referencing the id of the audio or video element.

Live

Steps:

  1. Add an id attribute to your <ef-audio> or <ef-video> element.
  2. Set the target attribute on <ef-waveform> to match that id value.
  3. The waveform will automatically synchronize with the target element's playback.

The waveform receives real-time audio frequency data from the target element and visualizes it during playback.