summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/MirLua/src/m_sound.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_sound.cpp b/plugins/MirLua/src/m_sound.cpp
index 00b3bdf963..3411f72971 100644
--- a/plugins/MirLua/src/m_sound.cpp
+++ b/plugins/MirLua/src/m_sound.cpp
@@ -32,11 +32,23 @@ static int lua_Play(lua_State *L)
return 1;
}
+static int lua_PlayFile(lua_State *L)
+{
+ const char *path = luaL_checkstring(L, 1);
+
+ INT_PTR res = SkinPlaySoundFile(ptrT(mir_utf8decodeT(path)));
+ lua_pushnumber(L, res);
+
+ return 1;
+}
+
static luaL_Reg soundApi[] =
{
{ "Add", lua_Add },
{ "Play", lua_Play },
+ { "PlayFile", lua_PlayFile },
+
{ NULL, NULL }
};