为什么在播放时我的waveurfer.js有2个波形?

时间:2019-10-12 19:34:37

标签: javascript audiocontext wavesurfer.js

我有:

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");
      });

效果很好: enter image description here

但是当我播放时,显示了另一个波形: enter image description here

我在做什么错了?

1 个答案:

答案 0 :(得分:0)

将它们设置为相同的颜色似乎可以解决此问题:

        waveColor: "blue",
        progressColor: "red"