Exemple #1
0
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_dcblock *unit[NUM];

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

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

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

    sp_destroy(&sp);
    return 0;
}
    void init(int channelCount, double inSampleRate) {
        channels = channelCount;

        sampleRate = float(inSampleRate);

        sp_create(&sp);
        sp_dcblock_create(&dcblock);
        sp_dcblock_init(sp, dcblock);
    }
Exemple #3
0
void growl_init(sp_data *sp, growl_d *form)
{
    int i;
    for(i = 0; i < 4; i++) {
        sp_reson_init(sp, form->filt[i]);
        form->filt[i]->freq = formants[i];
        form->filt[i]->bw =
            (formants[i] * 0.02) + 50;
    }
    sp_bal_init(sp, form->bal);
    sp_dcblock_init(sp, form->dcblk);
    form->x = 0;
    form->y = 0;
}