General code clean up, made it more dynamic.

Moved some variables to the top and into a global context to make it easy
to define output wav file format.

Added a hash of values to convert audio output preferences into the single
integer expected by SAPI5.