Move portaudio code to its own file