Maybe it would be easier to replace the soundfile(s) ?
Or have init- and cleanup-functions that swap the original-
and the replacement-files at start and end of the program.
I could see that being an easier process, but:
1) I've seen a few soundpack mods that are just installing the old files over the new ones, and want to create a cleaner process to use them without removing the default sounds completely
2) I don't know how good LUA is at file management, and might have to manage this for both Linux and Windows filesystems.
3) I'd have to either back up the original sound files in a "last known" folder or rename the default sounds folder to a default sounds bak folder and create a link
4) That wouldn't work if something caused Minetest to crash before the sounds are returned, and then players will need to manually update their sounds from the repo/zip
Most of the sounds have been updated through the override_item command. I'm thinking I can try again by directly overriding the function like this:
old_function = default_function_name
default_function_name = function(...)
some stuff I'd rather do
if not predefined_process
old_function(...) -- If the new function doesn't handle it
end