Closing of wave output devices is functional and terminates the sound thread