Implemented a portaudio callback for the portaudio backend