/* 
 * translations.js
 *
 * Any2All value-to-human readable translations
 *
 * &L(0,"*",1);
 */
function set_audio_format()
{
	var af=&LSetup(1,"%u",608);;
	var sr=&LSetup(1,"%u",603);;
	var qu=&LSetup(1,"%u",604);;
	var au_fmt="";
	switch (af) {
	case 0:
		au_fmt="MPEG "; 
		switch(sr) {
		case 4: au_fmt+= "16 Khz "; break;
		case 0: au_fmt+= "22.05 Khz "; break;
		case 2: au_fmt+= "24 Khz "; break;
		case 5: au_fmt+= "32 Khz "; break;
		case 1: au_fmt+= "44.1 Khz "; break;
		case 3: au_fmt+= "48 Khz "; break;
		}
		au_fmt+="Quality "+qu;
	break;
	case 1: au_fmt="uLaw "; break;
	case 2: au_fmt="aLaw "; break;
	}
	if (af!=0) {
		if (sr==2) au_fmt+="24 Khz";
		if (sr==8) au_fmt+="8 Khz";
	}
	return au_fmt;
}

function getDecFormat(fmt)
{
	switch(parseInt(fmt,10))
	{
	case   0: return "u-Law, 8bit, mono, 8kHz";
	case   8: return "A-Law, 8bit, mono, 8kHz";
	case  97: return "u-Law, 8bit, mono, 24kHz";
	case  98: return "A-Law, 8bit, mono, 24kHz";
	case  14: return "MPEG audio";
	case 127: return "error, unrecognized format";
	default:
		return "no incoming stream";
	break;
	}
}