As it is currently written it is nearly impossible to determine which sounds can be used or how to use anything other than what is explicitly listed in the examples.
For example, "utility/wire_connect_pole" works, and is the first example in the API, but "entity-vehicle_impact/car-stone-impact" does not. The type is listed in the API, and the name was taken from the sound folder and assumed to be under that type.
I would suggest one of the following changes to the API or its documentation:
- Ideally, make all sounds in data/base/sound accessible by the play_sound{} function by the relative path in the folder.
- Otherwise, make an all inclusive list of available sounds and add it to the API in addition to the existing example
For those who want to quickly look the following links will take you to the function and soundpath object.
https://lua-api.factorio.com/latest/Lua ... play_sound
https://lua-api.factorio.com/latest/Con ... #SoundPath
Edit: Turns out the sounds in the data folder are not directly used. "entity-vehicle_impact/tree-01" works, because it wants an entity in name, and then goes and finds the appropriate sound for a vehicle colliding with that entity, I guess? I assume the rest of the type examples work in a similar way using an entity name, not a sound filename. This could be made more clear in the API if neither of the above are good solutions to this "problem"