let EV_SOUND_PLAY = 301;
let EV_SOUND_STOP = 302;

function PlaySound(name,vol)
	{
	NotifyEventAll(EV_SOUND_PLAY,[SENameToNumb(name),vol]);
	}

task EndSound(name)
	{
	NotifyEventAll(EV_SOUND_STOP,[SENameToNumb(name)]);
	}

task DelaySound(name,vol,time)
	{
	loop(time){yield;}
	PlaySound(name,vol);
	}
function SENumbToName(numb)
	{
	let name = "se_Invalid";
	alternative(numb)
		case(0)
			{
			name = "se_Bonus";
			}
		case(1)
			{
			name = "se_Boost";
			}
		case(2)
			{
			name = "se_Boost2";
			}
		case(3)
			{
			name = "se_Boost3";
			}
		case(4)
			{
			name = "se_Cancel";
			}
		case(5)
			{
			name = "se_Charge";
			}
		case(6)
			{
			name = "se_Confirm";
			}
		case(7)
			{
			name = "se_Damage";
			}
		case(8)
			{
			name = "se_DeathBomb";
			}
		case(9)
			{
			name = "se_Die";
			}
		case(10)
			{
			name = "se_Die2";
			}
		case(11)
			{
			name = "se_Die3";
			}
		case(12)
			{
			name = "se_Die4";
			}
		case(13)
			{
			name = "se_Die5";
			}
		case(14)
			{
			name = "se_Event1";
			}
		case(15)
			{
			name = "se_Event2";
			}
		case(16)
			{
			name = "se_Event3";
			}
		case(17)
			{
			name = "se_Event4";
			}
		case(18)
			{
			name = "se_Explosion";
			}
		case(19)
			{
			name = "se_Extend";
			}
		case(20)
			{
			name = "se_Flashbomb";
			}
		case(21)
			{
			name = "se_Gap";
			}
		case(22)
			{
			name = "se_Graze";
			}
		case(23)
			{
			name = "se_Invalid";
			}	
		case(24)
			{
			name = "se_Item";
			}
		case(25)
			{
			name = "se_Item2";
			}
		case(26)
			{
			name = "se_Laser";
			}
		case(27)
			{
			name = "se_LaserDelay";
			}
		case(28)
			{
			name = "se_Laugh";
			}
		case(29)
			{
			name = "se_MasterSpark";
			}
		case(30)
			{
			name = "se_Option";
			}
		case(31)
			{
			name = "se_Option2";
			}
		case(32)
			{
			name = "se_Pause";
			}
		case(33)
			{
			name = "se_Phantom";
			}
		case(34)
			{
			name = "se_Phantom2";
			}
		case(35)
			{
			name = "se_PlayerDie";
			}
		case(36)
			{
			name = "se_PlayerShot1";
			}
		case(37)
			{
			name = "se_PlayerShot2";
			}
		case(38)
			{
			name = "se_Select";
			}
		case(39)
			{
			name = "se_Shatter";
			}
		case(40)
			{
			name = "se_Shift";
			}
		case(41)
			{
			name = "se_Shot1";
			}
		case(42)
			{
			name = "se_Shot2";
			}
		case(43)
			{
			name = "se_Shot3";
			}
		case(44)
			{
			name = "se_Shot4";
			}
		case(45)
			{
			name = "se_Shot5";
			}
		case(46)
			{
			name = "se_Shot6";
			}
		case(47)
			{
			name = "se_Shot7";
			}
		case(48)
			{
			name = "se_Spell";
			}
		case(49)
			{
			name = "se_SpellBreak";
			}
		case(50)
			{
			name = "se_SpellEnd";
			}
		case(51)
			{
			name = "se_SpellFail";
			}
		case(52)
			{
			name = "se_Time1";
			}
		case(53)
			{
			name = "se_Time2";
			}
		case(54)
			{
			name = "se_Charge2";
			}
	return name;
}

function SENameToNumb(name)
	{
	let numb = 23;
	alternative(name)
		case("se_Bonus")
			{
			numb = 0;
			}
		case("se_Boost")
			{
			numb = 1;
			}
		case("se_Boost2")
			{
			numb = 2;
			}
		case("se_Boost3")
			{
			numb = 3;
			}
		case("se_Cancel")
			{
			numb = 4;
			}
		case("se_Charge")
			{
			numb = 5;
			}
		case("se_Confirm")
			{
			numb = 6;
			}
		case("se_Damage")
			{
			numb = 7;
			}
		case("se_DeathBomb")
			{
			numb = 8;
			}
		case("se_Die")
			{
			numb = 9;
			}
		case("se_Die2")
			{
			numb = 10;
			}
		case("se_Die3")
			{
			numb = 11;
			}
		case("se_Die4")
			{
			numb = 12;
			}
		case("se_Die5")
			{
			numb = 13;
			}
		case("se_Event1")
			{
			numb = 14;
			}
		case("se_Event2")
			{
			numb = 15;
			}
		case("se_Event3")
			{
			numb = 16;
			}
		case("se_Event4")
			{
			numb = 17;
			}
		case("se_Explosion")
			{
			numb = 18;
			}
		case("se_Extend")
			{
			numb = 19;
			}
		case("se_Flashbomb")
			{
			numb = 20;
			}
		case("se_Gap")
			{
			numb = 21;
			}
		case("se_Graze")
			{
			numb = 22;
			}
		case("se_Invalid")
			{
			numb = 23;
			}	
		case("se_Item")
			{
			numb = 24;
			}
		case("se_Item2")
			{
			numb = 25;
			}
		case("se_Laser")
			{
			numb = 26;
			}
		case("se_LaserDelay")
			{
			numb = 27;
			}
		case("se_Laugh")
			{
			numb = 28;
			}
		case("se_MasterSpark")
			{
			numb = 29;
			}
		case("se_Option")
			{
			numb = 30;
			}
		case("se_Option2")
			{
			numb = 31;
			}
		case("se_Pause")
			{
			numb = 32;
			}
		case("se_phantom")
			{
			numb = 33;
			}
		case("se_phantom2")
			{
			numb = 34;
			}
		case("se_PlayerDie")
			{
			numb = 35;
			}
		case("se_PlayerShot1")
			{
			numb = 36;
			}
		case("se_PlayerShot2")
			{
			numb = 37;
			}
		case("se_Select")
			{
			numb = 38;
			}
		case("se_Shatter")
			{
			numb = 39;
			}
		case("se_Shift")
			{
			numb = 40;
			}
		case("se_Shot1")
			{
			numb = 41;
			}
		case("se_Shot2")
			{
			numb = 42;
			}
		case("se_Shot3")
			{
			numb = 43;
			}
		case("se_Shot4")
			{
			numb = 44;
			}
		case("se_Shot5")
			{
			numb = 45;
			}
		case("se_Shot6")
			{
			numb = 46;
			}
		case("se_Shot7")
			{
			numb = 47;
			}
		case("se_Spell")
			{
			numb = 48;
			}
		case("se_SpellBreak")
			{
			numb = 49;
			}
		case("se_SpellEnd")
			{
			numb = 50;
			}
		case("se_SpellFail")
			{
			numb = 51;
			}
		case("se_Time1")
			{
			numb = 52;
			}
		case("se_Time2")
			{
			numb = 53;
			}
		case("se_Charge2")
			{
			numb = 54;
			}
	return numb;
}