<< Newer | Article #67 | Older >> |
Speakers and sounds
As I mentioned before, I've been on a crusade to rework the sound cores to be more "object oriented". Phase one of that is done, which means that all the sound cores now compile with the new interfaces introduced. In theory I could tell if everything was working except for the fact that I need to also change all the drivers to speak to the new interfaces. That will take a little while, so I'll wait for 0.92 to be officially released before I start digging into that bit of fun.
In the meantime, I've expanded my plans for configuring sound, which should make it possible for more interesting sound configurations in the future.
Right now, each sound chip has a certain number of output "streams". Each stream is configured within each sound chip to go either to the left, to the right, or both. But if you think about a real cabinet, that's not how it works. In a cabinet, there are 1 or more speakers, and each output stream is directed at a particular speaker, with potentially some per-channel gain.
So really, MAME should define a series of "speakers" (along with the position of each speaker relative to a typical player's ears). And then instead of specifying the left/right/center position of each stream coming out of each sound chip, MAME will specify the speaker ID for each stream, along with a gain factor to control mixing. Of course, there will be standard mono 1-speaker configurations, and standard stereo 2-speaker configuations, but you could also define custom speaker layouts for games with more speakers.
Eventually, down the road, the OS-dependent code could take the information about where each speaker is located, and use 3D sound positioning to make the sound appear to come from that location. In the short term, however, the mixer code will simply mix this information internally into regular stereo left/right streams. The fancy stuff can come later. :)
So, while I'm visiting all the drivers to update their sound configurations, I will also be adding this speaker routing information. I won't be adding quad sound to Pole Position right away, but I'll get things started by getting the infrastructure together to make it work ... eventually.