Overlay playing using the same mixer

Started by alexeyZ,

alexeyZ

I have an internet radio application. For broadcasting, I am using the following steps:

  • download a track and put this track into the mixer that I created using(BASS_Mixer_StreamCreate)
  • add sync handler(BASS_ChannelSetSync) for downloading the next track, and add this track to the mixer
  • reset the mixer using BASS_ChannelSetPosition method

Now I want to implement some overlay playing with the same algorithm. Can I do this with the same mixer that I am using for the regular playing, or do I need 2 separate mixers?

I tried to do this with the same mixer but seems in this case, we call BASS_ChannelSetPosition from regular and overlay playing and my broadcasting just stops.

Ian @ un4seen

If I understand correctly, you're basically using a mixer to gaplessly play files, and now you want to do that for multiple files at a time? If you're using a BASS_SYNC_END sync on the mixer to start the next file, that won't work as wanted when there are multiple sources because it won't be triggered until all of them have ended. So you would probably need to use multiple mixers, one for each file sequence. If you need it all in a single mix, then you could have a master mixer into which the file mixers are plugged. Note that those submixers will need to have the BASS_STREAM_DECODE flag set, just like the file streams feeding them.

If you haven't already done so, you could also check the BASS_MIXER_QUEUE option (see the BASS_Mixer_StreamCreate documentation for details). It won't change the submixer requirement, but might make things a bit cleaner (avoid the need for resetting them via BASS_ChannelSetPosition).

alexeyZ

Thanks for the solution. The approach with the multiple mixers and the BASS_STREAM_DECODE flag works fine.