change decode.c to support input from STDin and variable samplerate