Coding the mixer

For the purposes of demonstration, we assume that the simplified codec shown in the previous figure represents the mixer that you plan to support. The rest of this chapter demonstrates how to translate this relatively standard diagram into code.

The complete code for the sample mixer in this chapter is available in the Sample Mixer Source appendix.

Before we can write any of the mixer code, we need to get some basic requirements of the driver out of the way. We need a build environment to build this code as a DLL, and we need to provide a standard entry point for io-audio to call to initialize the chip. The easiest way to do this is to copy the Sound Blaster driver directory ( sb ) to a directory named for your card.

After copying the directory, you should rename the C, header, and usage-message files to something more descriptive of your chip. After doing this, make sure the code still compiles before proceeding.