I have modified my block. Now it works well for 10-15 seconds and then dies.
My block have two inputs:
- Signal
- Control delay: number of samples to delay
And one output:
- New signal
In the image example:
** Current delay = 0
---> Delay = 1
current_delay < delay ->delay of 1 sample
I insert a virtual sample (linear interpolation)
I sent the next sample (2)
current_delay = 1
---> Delay = 1
current_delay = delay -> nothing
I send the next sample (3)
current_delay = 1
---> Delay = 1
current_delay = delay -> nothing
I send the next sample (4)
current_delay = 1
---> Delay = 2
current_delay < delay -> delay of 1 sample (delay-current_delay)
I insert a virtual sample
I send the next sample (5)
current_delay = 2
---> Delay = 1
current_delay > delay ->ADVANCE 1 sample
I delete a sample (6)
I send the next sample (7)
current_delay = 1
Attach the code.
*** The value of control block is about 400000
Thank you ;)