universal_newlines uses system locale which is ascii on osx unless
LC_CTYPE/LANG is set to utf8, so we need to be explicit about the
encoding we want instead
we also lose line buffering, so we have to explicitly flush
The 64 bit built of portaudio on OSX seems to generate a wav
file that says it's 44100 but is actually the default rate, leading
to samples playing too fast or slow.