compute sound value in buffer