Is it possible to have a sound output device object and send it PCM to have played? Otherwise it would be very unfeasible to implement a custom audio format.
In laymens terms, I'd like to manually buffer audio.
Just throwing this out there, Alt+F4 just emulates clicking the close button and for no reason should cause a termination. If the application won't obey and there's no other way, you terminate the process in task manager. Command Q as far as I know terminates the program, however.