I re-wrote the audio capture code in Python using PyAudio. This is much cleaner now as the whole thing can be done in Python, and it works on Ubuntu!
I also had some graphics plotted really badly using win32 APIs. I rewrote that section of code using matplotlib so it looks much nicer now and is more responsive.