I’ve done some more work on the audio core stuff. It only now occurred to me to test how heavy this all stuff is actually to run under realtime playback. I was expecting pretty horrendous results since not much has yet been optimized. The code has all kinds of nasty inefficient loops and if-conditionals etc. It has been more important to concentrate on the architecture of all it at this stage. So, I set up a test set of sound objects to play, 32 stereo sound files streamed from the hard drive, using a very naive implementation that doesn’t even use an additional worker thread for the disk I/O. (Which would be The Right Thing(tm) to do.) Would it use 25% CPU during the simultaneously playing voices? 10% with luck? No, it turns up the test case uses under 2% as measured by Process Explorer! (Process Explorer is the Windows Task Manager replacement I would encourage everybody to use instead of TM.) Note that 25% would be the maximum the current single threaded architecture could utilize out of my quad core machine.
Now OK, granted, the test case is purely contrived, the test audio file is probably in the operating system file cache etc, but I am still quite positively surprised by this result. I am sure these results are easily changed to the worse by for example using completely different physical files (only 1 is now used for this test), adding some more DSP to the audio objects to do (resampling, fancy volume and pan envelopes etc). Still, it’s not bad at all.