Safer wave file creation, less chances for race conditions.