Index: code/parse/lua.cpp
===================================================================
--- code/parse/lua.cpp	(revision 8898)
+++ code/parse/lua.cpp	(working copy)
@@ -9013,6 +9013,40 @@
 //**********LIBRARY: Audio
 ade_lib l_Audio("Audio", NULL, "ad", "Sound/Music Library");
 
+ADE_FUNC(getSoundentry, l_Audio, "string/number", "Return a sound entry matching the specified index or name. If you are using a number then the first valid index is 1", "soundentry", "soundentry or invalid handle on error")
+{
+	int index = -1;
+
+	if (lua_isnumber(L, 1))
+	{
+		int idx = -1;
+		if(!ade_get_args(L, "i", &idx))
+			return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+		
+		index = gamesnd_get_by_tbl_index(idx);
+	}
+	else
+	{
+		char *s = NULL;
+		if(!ade_get_args(L, "s", &s))
+			return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+
+		if (s == NULL)
+			return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+
+		index = gamesnd_get_by_name(s);
+	}
+
+	if (index < 0)
+	{
+		return ade_set_args(L, "o", l_SoundEntry.Set(sound_entry_h()));
+	}
+	else
+	{
+		return ade_set_args(L, "o", l_SoundEntry.Set(sound_entry_h(0, index)));
+	}
+}
+
 ADE_FUNC(playGameSound, l_Audio, "Sound index, [Panning (-1.0 left to 1.0 right), Volume %, Priority 0-3, Voice Message?]", "Plays a sound from #Game Sounds in sounds.tbl. A priority of 0 indicates that the song must play; 1-3 will specify the maximum number of that sound that can be played", "boolean", "True if sound was played, false if not (Replaced with a sound instance object in the future)")
 {
 	int idx;
