There was a similar suggestion to this in the past by
Toderon.
http://starmadedock.net/threads/ingame-musicplayer.5530/#post-82328
It was mostly intended for playing music and audio announcements in game, but if we get custom sound system that is designed to be controllable via logic we could do lots of custom ship sounds as well.
A rundown of how I imagine such a system would work:
- A new "Audio" block could be placed and modified by pressing the activation key while looking at it.
- In this block's configuration menu, you could assign it an audio file that has been uploaded to the server (Allowing server Admins to pre-approve audio files before allowing them to be used, preventing some abuse). Perhaps they could also be attached to ship blueprints so that ships with custom sounds could be transferred easily from server to server.
- The range that the sound will be audible could be indicated in build mode with a wire-frame UI object, similar to the Boxes used to indicate docking areas. Although in this case we may want to use a sphere that is centered on the block, as that might be a better indication of audibility range than boxes. And perhaps there could also be two or more spheres, each indicating the volume that the audio will be played at, with the larges spheres being X% quieter than the smaller ones.
- A new block called an Audio Enhancer could be linked to the Audio block in much the same way docking enhancers are linked to docks. This way we can expand the range of the audio.
- Other configuration options for the Audio block could be:
- LoopCount[#] (Number of times to loop, Zero would be considered no limit, and One would be the same as having looping set to off)
- RepeatCount[#] (Number of times to repeat per loop, or activation)
- Break[Y/N] (Play the file to the end of the current loop or stop immediately when turned off)
- Interval[##-Seconds] (delay between repeated/looped audio)
- When the Audio Block receives an on signal from logic, it will start to play the audio file according to it's configuration.
- When it receives an off signal it turns off according the Break setting.
-Audio blocks will only play for people who are Aligned/Attached/Gravity/etc to the Entity on which the Audio block is placed.