Upgraded wasapi to use CreateThread