Module talk:audio

Usage
@Surjection Hello, am I correctly understanding the usage of  in this module? I am trying to call it like this:

local function show_audio_file(file, caption) caption = caption or "Audio" return require("Module:audio").format_audios (		{		 lang = lang,		  audios = {{file = {file}, }, },		  caption = caption		}	) end ... to format audios in the module at Module:User:Kiril kovachev/bg-pronunciation. But I'm getting Lua error: invalid replacement value (a table) with a stack trace:

Backtrace:


 * 1) [C]: in function "v"
 * 2) mw.ustring.lua:84: in function "gsub"
 * 3) Module:audio:20: in function "format_audio_file"
 * 4) Module:audio:46: ?
 * 5) (tail call): ?
 * 6) Module:User:Kiril_kovachev/bg-pronunciation:401: in function "format_audio"
 * 7) Module:User:Kiril_kovachev/bg-pronunciation:447: in function "chunk"
 * 8) mw.lua:527: ?
 * 9) [C]: ?

As far as I can tell, I passed an object with the same format as the comment in the module described (I copy-pasted it an substituted my fields) but evidently I must be misunderstanding something. Thanks for any help, Kiril kovachev (talk) 12:41, 26 July 2023 (UTC)


 * I think it is a typo in the documentation. The filename shouldn't be inside a one-element table, so the correct format is  &mdash; S URJECTION  / T / C / L / 20:11, 26 July 2023 (UTC)
 * I see, thanks for the clarification. Kiril kovachev (talk) 10:46, 27 July 2023 (UTC)

use of table
Feel free to rework the HTML of the template. I just copied what was there already. Benwing2 (talk) 00:04, 4 June 2024 (UTC)