let se_ChargeLong = ObjSound_Create;
let se_ChargeShort = ObjSound_Create;
let se_CuteShotLong = ObjSound_Create;
let se_CuteShotMed = ObjSound_Create;
let se_CuteShotShort = ObjSound_Create;
let se_DeepShotHigh = ObjSound_Create;
let se_DeepShotMed = ObjSound_Create;
let se_DeepShotLow = ObjSound_Create;
let se_Die = ObjSound_Create;
let se_DieMid = ObjSound_Create;
let se_Laser = ObjSound_Create;

let se_load = false;

task PlaySound(obj,volume)
	{
	if(se_load == false)
		{
		Tse_load;
		se_load = true;
		}
	ObjSound_SetSoundDivision(obj,SOUND_SE);
	ObjSound_SetVolumeRate(obj,volume);
	ObjSound_Play(obj);
  
	loop(1){yield;}
	while(ObjSound_IsPlaying(obj) == true){yield;}
	ObjSound_Stop(obj);
	}

task Tse_load
	{
	ObjSound_Load(se_ChargeLong,GetCurrentScriptDirectory ~ "se/se_ChargeLong.wav");
	ObjSound_Load(se_ChargeShort,GetCurrentScriptDirectory ~ "se/se_ChargeShort.wav");
	ObjSound_Load(se_CuteShotLong,GetCurrentScriptDirectory ~ "se/se_CuteShotLong.wav");
	ObjSound_Load(se_CuteShotMed,GetCurrentScriptDirectory ~ "se/se_CuteShotMed.wav");
	ObjSound_Load(se_CuteShotShort,GetCurrentScriptDirectory ~ "se/se_CuteShotShort.wav");
	ObjSound_Load(se_DeepShotHigh,GetCurrentScriptDirectory ~ "se/se_DeepShotHigh.wav");
	ObjSound_Load(se_DeepShotMed,GetCurrentScriptDirectory ~ "se/se_DeepShotMed.wav");
	ObjSound_Load(se_DeepShotLow,GetCurrentScriptDirectory ~ "se/se_DeepShotLow.wav");
	ObjSound_Load(se_Die,GetCurrentScriptDirectory ~ "se/se_Die.wav");
	ObjSound_Load(se_DieMid,GetCurrentScriptDirectory ~ "se/se_DieMid.wav");
	ObjSound_Load(se_Laser,GetCurrentScriptDirectory ~ "se/se_Laser.wav");
	}