The audio.c as we have it is way too big to be understandable, it contains a few helper functions, a lot of init code and the implementation of wavein, waveout and dsound-like mmap. This patch splits it up in smaller pieces, which makes the code a lot more readable.