Cool, this is similar to what I proposed the last time sound effects and music came up. Part of the issue is that cross-platform audio support is even more fragmented than cross-platform graphics, so doing all this in-game encounters major issues with including libraries and keeping them happy, and also sound imposes asynchronous programming issues that we generally don’t have to worry about (and I’d like to keep it that way if possible).
On linux/mac the obvious way to do this is with either a named pipe, or a local socket. I think the simplest way to do this would be with a local UDP socket, and I’m sure that’s generic enough to work on all our target platforms. The cataclysm process would listen on a UDP socket (port determined by a config file probably, that way you can change it in case of conflicts, and the other side can read the config file too.), and if another process opens the socket, we start pushing out sound events in UDP packets, probably just ASCII encoded, or maybe json since we’re fairly standardised on that.
It really shouldn’t be all that hard to hook up the current sound infrastructure to spit out events when various things happen, and at some point we could either expand it to music control or add a seperate socket for that. That way you could have ambient events like “x monsters spotted” and “driving”, and “sleep”, “crafting”, whatever that could influence music, even procedural music generation if someone were interested in that.