void init(int channelCount, double inSampleRate) {
        channels = channelCount;

        sampleRate = float(inSampleRate);

        sp_create(&sp);
        sp->sr = sampleRate;
        sp->nchan = channels;
        sp_bal_create(&bal);
        sp_bal_init(sp, bal);
    }
Example #2
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;
}