Author Topic: streams  (Read 135 times)

jakob

  • Posts: 137
streams
« on: 16 Apr '21 - 09:29 »
hi Support
I have a question about streams when decoding. I have the following scenario:
i have create a mixer and attached a channel and are now getting the decoded audio via BASS_ChannelGetData.
Mu question is what will happen if I use BASS_ChannelSetPosition on the mixer handle compared to use it on the channel handle. I thin that using it on the channel it will set the position of the audio input to the mixer, but what about the mixer handle?

My need is actually to restart the mixer when it ends. My thought was to set the position to 0 and call BASS_ChannelGetData again.

jakob

  • Posts: 137
Re: streams
« Reply #1 on: 16 Apr '21 - 10:04 »
I have tried to use BASS_ChannelSetPosition on the mixer handle and then rerun the loop of getting data with BASS_ChannelGetData. But BASS_ChannelGetData return end of stream.

jakob

  • Posts: 137
Re: streams
« Reply #2 on: 16 Apr '21 - 10:27 »
Sorry for all the posts on the same topic. But here is one more. :-[
this is the mixer i use:
m_Stream = BassMix.BASS_Mixer_StreamCreate(output_samplerate, output_channels, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_MIXER_END);
i need the BASS_MIXER_END because i also want to detect the end of the channel input.

Ian @ un4seen

  • Administrator
  • Posts: 23626
Re: streams
« Reply #3 on: 16 Apr '21 - 14:50 »
My need is actually to restart the mixer when it ends. My thought was to set the position to 0 and call BASS_ChannelGetData again.

Mixers don't generally support seeking, except with the BASS_POS_DECODETO flag or with pos=0 to restart them. So your thought was correct. If the mixer's source has ended then you will need to reset that with BASS_ChannelSetPosition (or BASS_Mixer_ChannelSetPosition) too.

jakob

  • Posts: 137
Re: streams
« Reply #4 on: 19 Apr '21 - 08:39 »
hi
Resetting both the mixer and the channel, fixed it:

Bass.BASS_ChannelSetPosition(m_MixerHandle, 0);
BassMix.BASS_Mixer_ChannelSetPosition(m_ChannelHandle, 0);

Thank you for your help.