Programatical way to play audio
Posted: Tue Sep 20, 2016 1:50 am
Currently there's only 2 ways to play audio that I'm aware of:
1. Use an entity that makes sound (lots of processing overhead as the entity is doing a bunch of stuff I don't need)
2. GUI left-click sounds (only applicable to GUI).
I'd like a way to emit sound at a specific map location, without having to place an entity, ideally by first defining a `sound` prototype (so I can set volume via data.lua, preload, etc) and then using it via an API call (method on LuaSurface, possibly with ability to limit to specific player) passing in the name of the sound prototype.
If there are low-overhead ways to do this already, please let me know![Smile :)](./images/smilies/icon_e_smile.gif)
1. Use an entity that makes sound (lots of processing overhead as the entity is doing a bunch of stuff I don't need)
2. GUI left-click sounds (only applicable to GUI).
I'd like a way to emit sound at a specific map location, without having to place an entity, ideally by first defining a `sound` prototype (so I can set volume via data.lua, preload, etc) and then using it via an API call (method on LuaSurface, possibly with ability to limit to specific player) passing in the name of the sound prototype.
If there are low-overhead ways to do this already, please let me know
![Smile :)](./images/smilies/icon_e_smile.gif)