Search code examples
javascriptaudiocontextwavesurfer.js

Why do I have 2 waveforms with wavesurfer.js when playing?


I have:

this.wavesurfer = WaveSurfer.create({
        container: "#wavesurfer-player",
        height: 50,
        audioContext: _.get(this.$store, "state.audioContext.context"),
        waveColor: "blue",
        progressColor: "red"
      });
      this.wavesurfer.on("loading", progress => {
        this.loadingProgress = progress;
      });
      this.wavesurfer.load(this.url);

      this.wavesurfer.on("ready", () => {
        this.loadingProgress = 100;
        this.wavesurfer.un("ready");
      });

This works out well: enter image description here

But when I play, another waveform is shown: enter image description here

What am I doing wrong?


Solution

  • Setting them both to the same color seems to have solved this:

            waveColor: "blue",
            progressColor: "red"