shithub: soundpipe

ref: 6f50522ff66bbebd9d899f71b6da71288c0a8d0d
dir: /test/p/p_switch.c/

View raw version
#include <stdlib.h>
#include <stdio.h>
#include "soundpipe.h"
#include "config.h"

int main() {
    sp_data *sp;
    sp_create(&sp);
    sp_srand(sp, 12345);
    sp->sr = SR;
    sp->len = sp->sr * LEN;
    uint32_t t, u;
    SPFLOAT trig = 0, in1 = 0, in2 = 0, out = 0;

    sp_switch *unit[NUM];

    for(u = 0; u < NUM; u++) {
        sp_switch_create(&unit[u]);
        sp_switch_init(sp, unit[u]);
    }

    for(t = 0; t < sp->len; t++) {
        for(u = 0; u < NUM; u++) sp_switch_compute(sp, unit[u],
                &trig, &in1, &in2, &out);
    }

    for(u = 0; u < NUM; u++) sp_switch_destroy(&unit[u]);

    sp_destroy(&sp);
    return 0;
}