how to add delay to a mixer source?

Started by MB_SOFT, 26 Feb '25 - 13:52

MB_SOFT

i need an idea to add a little delay (0,5 secs or so) to a mixer source. the source is an handle from BASS_StreamCreateURL.

for a playing stream i can just increase the buffer but for a decode mixer source i have no guess

Ian @ un4seen

Perhaps you could simply use BASS_Mixer_StreamAddChannelEx's "start" parameter to delay the source? You can use BASS_ChannelSeconds2Bytes (on the mixer handle) to calculate that parameter value.

MB_SOFT

BASS_StreamCreateURL ---- DSP_DTMF_DETECTION --------------------------------------------------------------------------- MIXER

the problem is that i have a dsp that send data to a dtmf detction procedure and when a given code is detected i need to end the stream before the dtmf tone itself is played on the mixer.

so considering that my dtmf detection procedure can take up to 200 or 300 ms to detect the rigth dtmf code and call BASS_Mixer_ChannelRemove, i think i need some sort of delay between the DSP_DTMF_DETECTION and the mixer

i think i have to add a second DSP and create a delay procedure in memory (the mixer will receive the first 500 ms of silence)
BASS_StreamCreateURL ---- DSP_DTMF_DETECTION ------DSP_DELAY_500MS------------------------------------------------ MIXER

or do you think there is another way to add some sort of delay?


Ian @ un4seen

That looks like the DTMF detection DSP function should introduce the delay. You could have a FIFO buffer initially containing 500ms (or whatever delay you want) of silence (0s), which the DSP function writes data to and reads/returns data from. Note the DTMF detection processing would be on the new data going into the buffer, not the delayed data coming out.