added audio input and buffer code