Author Topic: Pausing sources plugged into a mixer  (Read 95 times)

Chris Oakley

  • Posts: 145
Pausing sources plugged into a mixer
« on: 25 May '21 - 10:14 »
I might be missing something really obvious here but is there a way to stop a decoding stream which gets added to a mixer from playing? I want to mix it to the mixer but need to control when it plays.

As soon as I call the BassMix.BASS_Mixer_StreamAddChannel and add it in to a playing mixer then it plays.

If I can't do that then how do you perform this? I have a number of sources I want to mix together but need to be able to pause and play them individually so stopping the mixer isn't an option.

Ian @ un4seen

  • Administrator
  • Posts: 23743
Re: Pausing sources plugged into a mixer
« Reply #1 on: 25 May '21 - 13:15 »
You can pause the mixing of a source by setting the BASS_MIXER_CHAN_PAUSE flag on it, either in the BASS_Mixer_StreamAddChannel(Ex) call or with BASS_Mixer_ChannelFlags. Unset the flag to resume.

Code: [Select]
BASS_Mixer_ChannelFlags(source, BASS_MIXER_CHAN_PAUSE, BASS_MIXER_CHAN_PAUSE); // set PAUSE flag
...
BASS_Mixer_ChannelFlags(source, 0, BASS_MIXER_CHAN_PAUSE); // remove PAUSE flag

Chris Oakley

  • Posts: 145
Re: Pausing sources plugged into a mixer
« Reply #2 on: 25 May '21 - 13:20 »
Thanks Ian, so if I've got 3 source channels going into 1 mixer I can pause the individual source channels without affecting anything else or the main mixer?

Ian @ un4seen

  • Administrator
  • Posts: 23743
Re: Pausing sources plugged into a mixer
« Reply #3 on: 25 May '21 - 13:35 »
Yes, you can.

Chris Oakley

  • Posts: 145
Re: Pausing sources plugged into a mixer
« Reply #4 on: 25 May '21 - 14:50 »
Brilliant, thanks Ian :)