chenlh
2026-03-26 36e42207da4c088b5bfd96f2cfc8944f890440d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "delay_mono.h"
#include "delay_mono_wrapper.h"
 
 
static int ch,n,L;
static float *y[32];
 
 
void delay_mono_wrapper_init(void **p, int channels, int frame_size, double sample_rate, double wet_dry, double set_delay, double feed_back, double high_ratio, double hpf, double lpf)
{
    Delay_mono_param param = {sample_rate, wet_dry, set_delay, feed_back, high_ratio, hpf, lpf};
    *(Delay_mono **)p = delay_mono_new(channels, frame_size, &param);
    ch = channels;
    n = frame_size;
}
 
 
void delay_mono_wrapper_process(void *p, double sample_rate, double wet_dry, double set_delay, double feed_back, double high_ratio, double hpf, double lpf, float *src, float *dst)
{
    int i;
    Delay_mono_param param = {sample_rate, wet_dry, set_delay, feed_back, high_ratio, hpf, lpf};
    L = ch * n;
    for(i = 0; i < L; i ++)
        dst[i] = src[i];
 
    for(i = 0; i < ch; i ++)
        y[i] = dst + i * n;
 
    delay_mono_process((Delay_mono *)p, y, &param);
}
 
 
void delay_mono_wrapper_delete(void *p)
{
    delay_mono_delete((Delay_mono *)p);
}