You could do something like this.
Code:
local SongList={
"songA";
"songB";
"songC";
};
print(SongList[math.random(#SongList)]);
This should print a random string grabbed from
SongList. The length operator (#) returns the length of the table (number of consecutive numerical indices starting at 1). Giving only one argument to
math.random() is the same as calling
math.random(1,n) where
n is the number you're passing it.
PS: If you're referencing sounds located in your addon folder, you need to make sure the path is formatted relative to WoW's root directory.
It should look something like this:
Code:
"Interface\\AddOns\\YourAddOn\\PathToSound"