int audio_callback( const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData ) { float *in = (float*) inputBuffer, *out = (float*)outputBuffer; int i; // bara mono atm memcpy(comp, in, bytes); flanger(in, line(.0001f, dur, dtime, &ts, def_cr), 0.4f, dtime, del, &pt, framesPerBuffer, SAMPLING_RATE); balance(in, comp, del1, freq, framesPerBuffer, SAMPLING_RATE); memcpy(out, in, bytes); return paContinue; }
char *play(t_platine *p) { char *str; if (p->cmd[p->index][0] == '#') str = strdup("shrrrck"); else str = remove_cut(strdup(p->cmd[p->index])); if (p->lowpass == 1) str = filter_lowpass(str); if (p->highpass == 1) str = filter_highpass(str); if (p->doubl == 1) str = fx_double(str); if (p->flanger == 1) str = flanger(str); if (p->echo == 1) str = fx_echo(str); reset_all_fx(p); if (p->reversed == 1) return (revstr(str)); return (str); }