void Use_Target_Speaker (edict_t *ent, edict_t *other, edict_t *activator)
{
//	int		chan;

//	if (ent->spawnflags & 3)
//	{	// looping sound toggles
//		if (ent->s.sound)
//			ent->s.sound = 0;	// turn it off
//		else
			ent->s.sound = ent->noise_index;	// start it
//	}
//	else
//	{	// normal sound
//		if (ent->spawnflags & 4)
//			chan = CHAN_VOICE|CHAN_RELIABLE;
//		else
//			chan = CHAN_VOICE;
		// use a positioned_sound, because this entity won't normally be
		// sent to any clients because it is invisible
//		gi.positioned_sound (ent->s.origin, ent, chan, ent->noise_index, ent->volume, ent->attenuation, 0);
//	}

		gi.positioned_sound(ent->s.origin, ent, CHAN_VOICE, ent->noise_index , 1, 1, 0);


}

void SP_target_speaker (edict_t *ent)
{
//	char	buffer[MAX_QPATH];


	ent->classname="target_speaker";

    
	
//	if(!st.noise)
//	{
//	    snd_fry1 = gi.soundindex  (st.noise);
//		gi.dprintf("target_speaker with no noise set at %s\n", vtos(ent->s.origin));
//		gi.dprintf("target_speaker with snd_fry1 noise set at %s\n", vtos(ent->s.origin));
		
//		return;
//	}


	
	
//	if (!strstr (st.noise, ".wav"))
//		Com_sprintf (buffer, sizeof(buffer), snd_fry1);
//	else
//		strncpy (buffer, snd_fry1, sizeof(buffer));
//    	ent->noise_index = snd_fry1;   //gi.soundindex (buffer);


//	if (!ent->volume)
//		ent->volume = 1.0;

//	if (!ent->attenuation)
//		ent->attenuation = 1;
//	else 
		
//	if (ent->attenuation == -1)	// use -1 so 0 defaults to 1
//		ent->attenuation = 0;

	// check for prestarted looping sound
//	ent->spawnflags = 1;
	ent->s.sound = snd_fry1;

	ent->use = Use_Target_Speaker;

	// must link the entity so we get areas and clusters so
	// the server can determine who to send updates to
	gi.linkentity (ent);
}
