shithub: soundpipe

ref: 25a9fcc24ad00c6a406042818b9e6f2e7bba0dd1
dir: soundpipe/test/p/p_bltriangle.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 in = 0, out = 0;

    sp_bltriangle *unit[NUM];

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

    for(t = 0; t < sp->len; t++) {
        for(u = 0; u < NUM; u++) sp_bltriangle_compute(sp, unit[u], &in, &out);
    }

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

    sp_destroy(&sp);
    return 0;
}