Author Topic: Can I add a mixer to another mixer by BASS_Mixer_StreamAddChannel  (Read 200 times)

songziyun

  • Posts: 32
Hi Ian
I created 2 mixers
And I want to add one mixer to another:
BASS_Mixer_StreamAddChannel(mixer2, mixer1, BASS_MIXER_CHAN_MATRIX | BASS_STREAM_AUTOFREE);
but it played no sound.
so is it possible?

Best regards
Ziyun


Ian @ un4seen

  • Administrator
  • Posts: 25732
Yes, it is possible to plug mixers into other mixers. Note that the source mixers need to have the BASS_STREAM_DECODE flag set, just like all other mixer sources. If it doesn't seem to be working then please check all BASS/BASSmix return values for any failures, and BASS_ErrorGetCode to find out why.

songziyun

  • Posts: 32
Thank you Ian.
It works now

songziyun

  • Posts: 32
Hi Ian,
I have another question
BASS_Split_StreamCreate does not work for mixer

when I Split a mixer ,ASIO could not work well

 m_mixers[1] = BASS_Split_StreamCreate(m_mixers[0],  BASS_STREAM_DECODE,0);
    if(m_mixers[1]==0){
        qDebug() << "BASS_Split_StreamCreate" << BASS_ErrorGetCode();
    }
    if (!BASS_ASIO_ChannelEnableBASS(FALSE, 4, m_mixers[1], TRUE)) {
        qDebug() << __LINE__ <<  BASS_ErrorGetCode() << ":" << BASS_ASIO_ErrorGetCode();
    }


    m_mixers[2] = BASS_Split_StreamCreate(m_mixers[0],  BASS_STREAM_DECODE ,0);
    if (!BASS_ASIO_ChannelEnableBASS(FALSE, 6, m_mixers[2], TRUE)) {
        qDebug() << __LINE__ <<  BASS_ErrorGetCode() << ":" << BASS_ASIO_ErrorGetCode();
    }

    if (!BASS_ASIO_Start(0, 0)) {
        qDebug() << BASS_ErrorGetCode();
    }

how to clone a mixer for asio?


Ok,I found BASS_ChannelSetDSP to push data to a stream.
So,this is the best way to clone Mixer?
« Last Edit: 6 Mar '24 - 07:50 by songziyun »

Ian @ un4seen

  • Administrator
  • Posts: 25732
What error codes are you getting from the BASS_Split_StreamCreate calls? Note that splitter sources (eg. m_mixers[0]) need to have the BASS_STREAM_DECODE flag set too, just like mixer sources.

songziyun

  • Posts: 32
HI Ian
No error,
m_mixers[0] was playing well.
but the sound of m_mixers[1]/m_mixers[2] was playing stutteringly




Ian @ un4seen

  • Administrator
  • Posts: 25732
Do they sound like they're playing too fast? If so, you may still have BASS_ChannelGetData/Level calls on m_mixers[0]. The data used by any such calls won't be seen by the splitters, which will make them sound fast. When using splitters, all access to the source's data needs to be through them.

songziyun

  • Posts: 32
HI Ian
Thank you for reply
The sound was off and on,off and on,not faster

Ian @ un4seen

  • Administrator
  • Posts: 25732
Oh, I'm not sure why that would be then, but it doesn't seem like something that's caused by splitters. Did you also change something in the mixer and its sources, or the BASSASIO setup? Try disabling things to locate where the problem is.