added audio and buffer code