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_ChargeLong";
			}
		case(1)
			{
			name = "se_ChargeShort";
			}
		case(2)
			{
			name = "se_CuteShotLong";
			}
		case(3)
			{
			name = "se_CuteShotMed";
			}
		case(4)
			{
			name = "se_CuteShotshort";
			}
		case(5)
			{
			name = "se_DeepShotHigh";
			}
		case(6)
			{
			name = "se_DeepShotMed";
			}
		case(7)
			{
			name = "se_DeepShotLow";
			}
		case(8)
			{
			name = "se_Die";
			}
		case(9)
			{
			name = "se_DieMid";
			}
		case(10)
			{
			name = "se_LaserLong";
			}
		case(11)
			{
			name = "se_Shot";
			}
		case(12)
			{
			name = "se_FloweyEvil";
			}
		case(13)
			{
			name = "se_FloweyNice";
			}
		case(14)
			{
			name = "se_FloweyLaugh";
			}
		case(15)
			{
			name = "se_PlayerDie";
			}
		case(16)
			{
			name = "se_Train";
			}
		case(17)
			{
			name = "se_LaserLong";
			}
		case(18)
			{
			name = "se_LaserStart";
			}
		case(19)
			{
			name = "se_Caution";
			}
		case(20)
			{
			name = "se_Gap";
			}
		case(21)
			{
			name = "se_SpellStart";
			}
		case(22)
			{
			name = "se_SpellBreak";
			}
		case(23)
			{
			name = "se_Illu";
			}
		case(24)
			{
			name = "se_MasterSpark";
			}
		case(25)
			{
			name = "se_Shake";
			}
	return name;
}

function SENameToNumb(name)
	{
	let numb = 0;
	alternative(name)
		case("se_ChargeLong")
			{
			numb = 0;
			}
		case("se_ChargeShort")
			{
			numb = 1;
			}
		case("se_CuteShotLong")
			{
			numb = 2;
			}
		case("se_CuteShotMed")
			{
			numb = 3;
			}
		case("se_CuteShotShort")
			{
			numb = 4;
			}
		case("se_DeepShotHigh")
			{
			numb = 5;
			}
		case("se_DeepShotMed")
			{
			numb = 6;
			}
		case("se_DeepShotLow")
			{
			numb = 7;
			}
		case("se_Die")
			{
			numb = 8;
			}
		case("se_DieMid")
			{
			numb = 9;
			}
		case("se_LaserLong")
			{
			numb = 10;
			}
		case("se_Shot")
			{
			numb = 11;
			}
		case("se_FloweyEvil")
			{
			numb = 12;
			}
		case("se_FloweyNice")
			{
			numb = 13;
			}
		case("se_FloweyLaugh")
			{
			numb = 14;
			}
		case("se_PlayerDie")
			{
			numb = 15;
			}
		case("se_Train")
			{
			numb = 16;
			}
		case("se_LaserShort")
			{
			numb = 17;
			}
		case("se_LaserStart")
			{
			numb = 18;
			}
		case("se_Caution")
			{
			numb = 19;
			}
		case("se_Gap")
			{
			numb = 20;
			}
		case("se_SpellStart")
			{
			numb = 21;
			}
		case("se_SpellBreak")
			{
			numb = 22;
			}
		case("se_Illu")
			{
			numb = 23;
			}
		case("se_MasterSpark")
			{
			numb = 24;
			}
		case("se_Shake")
			{
			numb = 25;
			}
	return numb;
}