Module:User:Surjection/audio

local export = {} local m_audio = require("Module:audio")

function export.show(frame) local params = { [1] = {required = true, default = "und"}, [2] = {list = true, required = true}, ["q"] = {list = true, allow_holes = true}, ["caption"] = {}, ["nocaption"] = {type = "boolean"}, }	local args = require("Module:parameters").process(frame:getParent.args, params) local lang = require("Module:languages").getByCode(args[1], 1)

local data = { lang = lang, audios = {}, caption = not args.nocaption and (args.caption or "Audio") or nil }	for i=1, #args[2] do		local audiofile = { file = args[2][i] } if args["q"][i] then audiofile.qualifiers = { args["q"][i] } end table.insert(data.audios, audiofile) end

return m_audio.format_multiple_audios(data) end

return export