Trouble muting channels separately with splitChannels #3811
Replies: 1 comment 2 replies
-
@katspaugh Please look into it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am implementing WaveSurfer in Angular 15. The only problem is that I'm unable to mute instances of channels separately. I tried using this.waveSurferInstance?.setTrackVolume(trackId, volume) with both track IDs, such as 0 and 1. However, when I provide 0, it mutes both channels, and when I provide 1, it doesn't have any effect.
playSingleTrack(trackId: number): void {
let volume = null;
if (trackId === 0) {
volume = this.isAgentTrackMuted ? 0 : 1;
this.waveSurferInstance?.setTrackVolume(trackId, volume); // Here i want mute channel 1 with trackId=0
this.isAgentTrackMuted = !this.isAgentTrackMuted;
}
else {
volume = this.isUserTrackMuted ? 0 : 1;
this.waveSurferInstance?.setTrackVolume(trackId, volume); //Here i want mute channel 2 with trackId=1
this.isUserTrackMuted = !this.isUserTrackMuted;
}
}
this.waveSurferInstance = MultiTrack.create([
{
id: 1,
draggable: false,
startPosition: 0,
url: Url,
options: {
splitChannels: [{
waveColor: 'rgba(71,147,175,0.5)',
progressColor: 'rgba(71,147,175,0.5)',
height: 100,
volume: 1.0,
},
{
waveColor: 'rgba(0,128,0,0.7)',
progressColor: 'rgba(0,128,0,0.7)',
height: 100,
volume: 1.0,
}
],
},
Beta Was this translation helpful? Give feedback.
All reactions