underfrankenwood
underfrankenwood

Reputation: 893

Load different audio files into single wavesurfer instance?

I have a couple of different .mp3 files, e.g. first is vocal.mp3, 2nd is drums.mp3 and last one is melody.mp3. Is there a way to load all of them into one wavesurfer instance? Like to have different channels with different audio sources. Thanks!

Question 2th: If so, is there a way to change volume of each channel?

Version: 7.4.2, but also tried the newest one 7.8.1

Edit: did something like that, but when playing only one audio is playing, not both. Also when removing the url property from the main object, the player doesnt load at all.

const ws = WaveSurfer.create({
    container: wavesurferRef.current,
    url: vocalURL,
    splitChannels: [
      {
        url: vocalURL,
        container: document.getElementById('ex1'),
        waveColor: theme.green,
      },
      {
        url: drumsURL,
        container: document.getElementById('ex2'),
        waveColor: theme.orange,
      },
    ],
  })

Upvotes: 0

Views: 58

Answers (0)

Related Questions