Author Topic: Problem setting channel volume to zero after BASS_ChannelSlideAttribute volume  (Read 479 times)

AndyMK

  • Posts: 211
Hi, I am have a problem setting a channels volume to zero while it is volume sliding. Sometimes it works, sometimes not. The channel is plugged in to a decoding mixer.

*edit

If I instead stop the channel, it works every time but I miss out on the volume ramping.
« Last Edit: 22 Sep '23 - 13:41 by AndyMK »

Chris

  • Posts: 2217
Hi

If an attribute is already sliding, then the old slide is stopped and replaced by the new one.

AndyMK

  • Posts: 211
Hi Chris,

I am trying to stop the channel that is sliding so that it does not play over the new sound that is triggered. The new sound is not sliding, its just playing. As it is, the old sliding sound continues with the newly triggered sound.

Ian @ un4seen

  • Administrator
  • Posts: 26095
BASS_ChannelSetAttribute won't cancel a slide. When you need to cancel a slide and set a new value, you should instead use BASS_ChannelSlideAttribute with time=0 for that, as it will replace/cancel the existing slide. Let me know if you see a problem even then.

AndyMK

  • Posts: 211
Hi Ian, is it not possible to set the volume of a sliding channel during the slide? I'm asking so I can understand how stuff is working internally.

*edit
I tried what you said and it works fine but please clarify my last question. Thanks

Ian @ un4seen

  • Administrator
  • Posts: 26095
BASS_ChannelSetAttribute will have successfully set the volume (BASS_ATTRIB_VOL), but it won't have cancelled the slide, so the slide would almost immediately change the volume again. The reason BASS_ChannelSetAttribute doesn't currently cancel a slide is because it is actually used internally by the slide, ie. BASS_ChannelSetAttribute is called periodically (usually every 10ms) to apply the slide. Volume changes are ramped in the output mix, so the slide steps will be smoothed away.

When playing through a mixer, volume slides can also be implemented with BASS_Mixer_ChannelSetEnvelope, if you would like them to be separate from the BASS_ATTRIB_VOL setting. BASS_FX_VOLUME effects (via BASS_ChannelSetFX) is another option.

AndyMK

  • Posts: 211