Not all Trains come withs speakers. This Feature could help it my simulating sounds with cordinates. 4 speakers would be used on each corner of the board to simulate the sound in a specific place. This is still inspired by the old Märklin 60128 Software:
It also would allow to simulate other sounds on the board. The best option for controlling the speakers would be just to select an speciffic sound adapter as examle in Windows. Some very thin and long boards could have problems with the sound volume. A fix would be to create a 6 or more speaker mode for this which would work like two normal 4 speaker boards joined togeter. The sounds could be called in code something like that:
-play3dsound whistle.mp3 x:12 y:133 volume:10
It could use custom mp3,wav,….. files to play it. A nice addition later down the line would be to create an own sound library.
I heard about OpenAL Soft but i never tested. But the basic features would be simple enought to do it from scratch. I made one simple basic windows executable for this in dev-c++. There is a config file for changing the audio device and the outputs and the Source code. I used additionaly dr_libs and a mp3 file is included for testing. It’s the first mp3 i found online as an example. It can be used by: 3dSound.exe file.mp3 X_cordinate Y_cordinate. just rename the file to “.zip“ i cant share zip files here. It’s quite unfinished and i only tested it on stereo speakers. I dont have any 4channel+ DACs laying around. I’m curently building one but i think i messed up in PCB design or got scammed buying the main discontiniued IC.