let musicObj = ObjSound_Create;

task PlayMusic(path,start,end)
	{
	LoadCommonDataAreaA2("CONFIG",GetCurrentScriptDirectory ~ "./data/CONFIG");
	musicObj = ObjSound_Create;
	ObjSound_Load(musicObj,path ~ ".ogg");	
	ObjSound_SetSoundDivision(musicObj, SOUND_BGM);
	ObjSound_SetLoopEnable(musicObj,true);
	ObjSound_SetRestartEnable(musicObj,true);	
	ObjSound_SetLoopTime(musicObj,start,end);
	ObjSound_SetVolumeRate(musicObj,GetAreaCommonData("CONFIG","MUSIC_VOLUME",1)*100);
	ObjSound_Play(musicObj);

  
	while(ObjSound_IsPlaying(musicObj) == true){yield;} 
	StopSound(path);
	RemoveSound(path);
	}