Author Topic: Audio glitches after a week  (Read 2590 times)

Ian @ un4seen

  • Administrator
  • Posts: 21379
Re: Audio glitches after a week
« Reply #25 on: 15 Aug '18 - 15:58 »
Yes, you need to have at least one splitter (on each source) without the BASS_SPLIT_SLAVE flag set, otherwise no data will ever be fetched from the source and there'll be nothing to process.

Chris Oakley

  • Posts: 96
Re: Audio glitches after a week
« Reply #26 on: 15 Aug '18 - 16:09 »
Thanks so much for your input on this Ian. If I knew where you were I'd send you a cake  :)

Chris Oakley

  • Posts: 96
Re: Audio glitches after a week
« Reply #27 on: 12 Sep '18 - 10:01 »
Hi Ian,

Sorry to bump an old thread, just a quick one. Is there a big difference between doing this

Code: [Select]
        Do Until bkgGetLocalMixer Is Nothing OrElse bkgGetLocalMixer.CancellationPending
            Dim Levels(2) As Single
            Bass.BASS_ChannelGetLevel(CastingMixer, Levels, 1, BASSLevel.BASS_LEVEL_STEREO)
            Threading.Thread.Sleep(100)
        Loop

and doing this?

Code: [Select]
        Dim LastMS As Integer = Environment.TickCount - 10

        Dim i As Integer = 0
        Do Until bkgGetLocalMixer Is Nothing OrElse bkgGetLocalMixer.CancellationPending

            Dim TimeNowMS As Integer = Environment.TickCount
            Dim Levels(2) As Single

            Bass.BASS_ChannelGetLevel(CastingMixer, Levels, (TimeNowMS - LastMS) / 1000, BASSLevel.BASS_LEVEL_STEREO)

            LastMS = TimeNowMS

            Threading.Thread.Sleep(10)

        Loop

Just trying to understand which is the best for processing data.

Ian @ un4seen

  • Administrator
  • Posts: 21379
Re: Audio glitches after a week
« Reply #28 on: 12 Sep '18 - 14:25 »
It depends on whether the "CastingMixer" channel's processing rate is limited elsewhere, eg. by BASSmix or BASSenc. If it is, then you can use the simple first loop. You would use the 2nd loop when you need to control the processing rate (to realtime speed) yourself.

Chris Oakley

  • Posts: 96
Re: Audio glitches after a week
« Reply #29 on: 12 Sep '18 - 14:40 »
Sorry, not sure what you mean by "limited elsewhere". As this is being passed to an encoder, I don't know if it needs to be realtime.

Ian @ un4seen

  • Administrator
  • Posts: 21379
Re: Audio glitches after a week
« Reply #30 on: 12 Sep '18 - 17:35 »
By "limited elsewhere", I meant that something else is already limiting the processing rate so you don't have to. If the channel has an encoder set on it then you can have that limit the rate to realtime speed by setting the BASS_ENCODE_LIMIT flag on the encoder. Likewise, if it's a splitter (which it seems to be from your other thread?) then the BASS_SPLIT_SLAVE flag will limit the processing to the rate of the other splitters on the same source, eg. if another splitter is being played then it will be limited to the speed of the playback.

Chris Oakley

  • Posts: 96
Re: Audio glitches after a week
« Reply #31 on: 14 Sep '18 - 09:29 »
Got you. Thanks for this, we seem to have it all sorted now. You're a superstar :)