



<div class="detailCon detailConMorePad">
	<ul class="line lineL">
		<div class="actionTitleDiv">
			<label class="actionTitle">{%label.audioInSet%}</label>
		</div>

		<div style="position:relative;*z-index:1;">
			<li class="line lineD hidden">
				<label class="des desA">{%label.sampleRate%}</label>
				<span class="selCon">
					<span id="sampleRate" class="select">
						<span class="value hsValueA"></span>
						<i class="arrow"></i>
					</span>
				</span>
			</li>
			<li class="line lineD">
				<label class="des desD">{%label.audioInputSwitch%}</label>
				<div id="inputMute" class="switchCon">
					<i class="switchBg"></i>
					<i class="switchBall"></i>
				</div>
				<label class="des desH"></label>
			</li>
			<div style="position:relative;*z-index:1;">
				<div id="hidebg"></div>
			</div>
			<li class="line lineD">
				<label class="des desA">{%label.audioInput%}</label>
				<span class="selCon">
					<span id="audioInput" class="select">
						<span class="value hsValueA"></span>
						<i class="arrow"></i>
					</span>
				</span>
			</li>
			<li class="line lineD">
				<label class="des desA">{%label.audioCode%}</label>
				<span class="selCon">
					<span id="audioType" class="select">
						<span class="value hsValueA"></span>
						<i class="arrow"></i>
					</span>
				</span>
			</li>
			<li class="dragLine">
				<div id="inputVolume" class="ipcDragLineDiv"></div>
			</li>
			<div class="height"></div>
			<li class="line lineD">
				<label id="noiseFilter" class="des desD">{%label.noiseFilter%}</label>
				<div id="noiseSwitch" class="switchCon">
					<i class="switchBg"></i>
					<i class="switchBall"></i>
				</div>
				<label class="des desH"></label>
			</li>

		</div>


		<div style="position:relative;z-index:1;" class="audioOutputDevice">
		<div id="audioOutSetTitle" class="actionTitleDiv">
			<label class="actionTitle">{%label.audioOutSet%}</label>
		</div>
			<li class="line lineD">
				<label class="des desD">{%label.audioOutSwitch%}</label>
				<div id="speakerMute" class="switchCon">
					<i class="switchBg"></i>
					<i class="switchBall"></i>
				</div>
				<label class="des desH"></label>
			</li>
			<div style="position:relative;*z-index:1;">
				<div id="hidebgA"></div>
			</div>
			<li class="line lineD">
				<label class="des desA">{%label.audioOutput%}</label>
				<span class="selCon">
					<span id="audioOutput" class="select">
						<span class="value hsValueA"></span>
						<i class="arrow"></i>
					</span>
				</span>
			</li>
			<li class="line lineD">
				<div id="speakerVolume" class="ipcDragLineDiv"></div>
			</li>
		</div>
		<div style="position:relative;*z-index:1;">
				<li class="line lineD hidden">
					<label class="des desA">{%label.bitrate%}</label>
					<span class="selCon">
						<span id="bitrate" class="select">
							<span class="value hsValueA"></span>
							<i class="arrow"></i>
						</span>
					</span>
				</li>
		</div>
	</ul>
	<!-- 功能按钮 -->
	<div class="funcBtnCon">
		<input id="reset" type="button" value="{%btn.resetDefault%}" class="subBtnB btnA" />
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA" />
	</div>
</div>
<script type="text/javascript">function init(){function E(a,e){var b="";switch(parseInt(a)){case ENONE:return!0;case IPCUBUSCONNFAIL:b=errStr.ipcUbusConnFail;break;case IPCUBUSCALLERR:b=errStr.ipcUbusCallErr;break;case IPCAUOPRERR:b=errStr.ipcAuOprErr;break;case IPCAUSRERR:b=errStr.ipcAuSrErr;break;case IPCAUCHNERR:b=errStr.ipcAuChnErr;break;case IPCAUCODERR:b=errStr.ipcAuCodErr;break;case IPCAUDECERR:b=errStr.ipcAuDecErr;break;case IPCAUVOLERR:b=errStr.ipcAuVolErr;break;case IPCAUDEVERR:b=errStr.ipcAuDevErr;break;case IPCAUBRERR:b=
errStr.ipcAuBrErr;break;case IPCUMGUESTNAUTH:showStr=errStr.invPermissionDenied;break;default:b=errStr.unknown+a}closeToast();showAlert(b);return!1}function O(){showConfirmC(btn.resetDefault,label.resetDefaultConfirm,function(a){!0==a&&(a={},a[v]={},a[v][F]={},a[v][F][P]=[m],showToast("loading"),$.action(a,function(a){!0==E(a[ERR_CODE])&&(showToast("success"),id("info_conf_stream_audio_rsMenu").onclick())}))})}function Q(a){t=1==a?n:q}function R(a){var e=id("hidebgA");r=1==a?q:n;0==a?(e.style.display=
"block",e.style.height=getoffset(id("speakerVolume")).top-getoffset(id("speakerMute")).top+"px"):e.style.display="none"}function S(a){var e=id("hidebg");s=0==a?n:q;0==a?(e.style.display="block",e.style.height=!0==g?getoffset(id("audioOutSetTitle")).top-getoffset(id("audioInput")).top+"px":getoffset(id("save")).top-getoffset(id("audioInput")).top+"px"):e.style.display="none"}function T(a){w=a;!0==checkNum(a)&&!0==checkNumRange(parseInt(a),100,0)?x=!1:(showNote("inputVolumeDragLineInput",errStr.audioVolumeErr),
x=!0)}function U(a){y=a;!0==checkNum(a)&&!0==checkNumRange(parseInt(a),100,0)?z=!1:(showNote("speakerVolumeDragLineInput",errStr.audioVolumeErr),z=!0)}function V(a){A.value=a}function W(a){B.value=a}function X(){if(!x&&!z){var a={},e,b;a[m]={};!0==g&&(e=a[m][uciAudio.secName.speaker]={});b=a[m][uciAudio.secName.microphone]={};!0==g&&(e.mute=r,e.volume=y,e.output_device_type=B.value);b.sampling_rate=G.value;b.channels=1;b.encode_type=H.value;c&&0!=parseInt(c[uciAudioCapability.optName.inputDeviceType])&&
(b.input_device_type=A.value);c&&1==parseInt(c[uciAudioCapability.optName.mute])&&(b.mute=s);c&&1==parseInt(c[uciAudioCapability.optName.noiseEliminate])&&(b.noise_cancelling=t);b.volume=w;c&&void 0!=c[uciAudioCapability.optName.bitrate]&&(b.bitrate=I.value);c&&1==parseInt(c[uciAudioCapability.optName.echoCancelling])&&(b.echo_cancelling=q);showToast("loading");$.modify(a,function(a){!0==E(a[ERR_CODE])&&showToast("success")})}}var H=$("#audioType")[0],A=$("#audioInput")[0],B=$("#audioOutput")[0],
G=$("#sampleRate")[0],I=$("#bitrate")[0],J=$(".audioOutputDevice"),K=id("reset"),Y=id("save"),m=uciAudio.fileName,n=uciAudio.optValue.enableVal.on,q=uciAudio.optValue.enableVal.off,L,C,M,D,N,t,r,s,y=50,w=50,v=uciSystem.fileName,F=uciSystem.actionName.configReset,P=uciSystem.optName.configName,x=!1,z=!1,c,p,f,l,g=$.moduleSpec.audio&&0<=$.inArray("speaker",$.moduleSpec.audio)?!0:!1,Z=$.moduleSpec.config_recovery&&0<=$.inArray("audio_config",$.moduleSpec.config_recovery)?!0:!1;(function(){Z?K.onclick=
O:$(K).hide();Y.onclick=X;var a={};a[uciAudioCapability.fileName]={};a[uciAudio.fileName]={};!0==g?(a[uciAudioCapability.fileName][NAME]=[uciAudioCapability.secName.devMicrophone,uciAudioCapability.secName.devSpeaker],a[uciAudio.fileName][NAME]=[uciAudio.secName.microphone,uciAudio.secName.speaker]):(a[uciAudioCapability.fileName][NAME]=[uciAudioCapability.secName.devMicrophone],a[uciAudio.fileName][NAME]=[uciAudio.secName.microphone]);$.query(a,function(a){ENONE==a[ERR_CODE]&&(c=a[uciAudioCapability.fileName][uciAudioCapability.secName.devMicrophone],
f=a[uciAudio.fileName][uciAudio.secName.microphone],!0==g&&(p=a[uciAudioCapability.fileName][uciAudioCapability.secName.devSpeaker],l=a[uciAudio.fileName][uciAudio.secName.speaker]));a=[{str:label.G711alaw,value:"G711alaw"},{str:label.G711ulaw,value:"G711ulaw"},{str:label.G711,value:"G711"},{str:label.G726,value:"G726"},{str:label.ADPCM,value:"ADPCM"},{str:label.AAC,value:"AAC"}];var b,k=[{str:label.LineOut,value:"LineOut"},{str:label.SpeakerOut,value:"SpeakerOut"},{str:label.auto,value:"Auto"}];
b=c&&1==parseInt(c[uciAudioCapability.optName.inputDeviceSupportAuto])?[{str:label.LineIn,value:"LineIn"},{str:label.MicIn,value:"MicIn"},{str:label.auto,value:"Auto"}]:[{str:label.LineIn,value:"LineIn"},{str:label.MicIn,value:"MicIn"}];if(1!=c[uciAudioCapability.optName.inputDeviceType]&&f&&f[uciAudio.optName.inputDeviceType]){audioInputType=f[uciAudio.optName.inputDeviceType];for(var h=[],d=0;d<b.length;d++)b[d].value==audioInputType&&h.push(b[d]);b=h}if(c&&c[uciAudioCapability.optName.encodeType]){encodeTypeList=
c[uciAudioCapability.optName.encodeType];h=[];for(d=0;d<a.length;d++)0<=$.inArray(a[d].value,encodeTypeList)&&h.push(a[d]);a=h}J.hide();!0==g&&J.show();if(!0==g&&1!=p[uciAudioCapability.optName.outputDeviceType]&&l&&l[uciAudio.optName.outputDeviceType]){audioOutputType=l[uciAudio.optName.outputDeviceType];h=[];for(d=0;d<k.length;d++)k[d].value==audioOutputType&&h.push(k[d]);k=h}if(!0==g&&p[uciAudioCapability.optName.outputDeviceList]){for(var h=[],m=p[uciAudioCapability.optName.outputDeviceList],
d=0;d<m.length;d++)for(var u=0;u<k.length;u++)k[u].value==m[d]&&h.push(k[u]);k=h}!0==g&&(L=new Switch("speakerMute",1,R),C=new DragLine({id:"speakerVolume",name:label.outputVolume,cb:U}),selectInit("audioOutput",k,"LineOut",W),C.setValue(50));selectInit("sampleRate",[{str:8,value:8},{str:16,value:16},{str:22.05,value:22.05},{str:44.1,value:44.1},{str:48,value:48}],8);selectInit("audioType",a,a[0].value);selectInit("audioInput",b,"LineIn",V);M=new Switch("inputMute",1,S);D=new DragLine({id:"inputVolume",
name:label.inputVolume,cb:T});N=new Switch("noiseSwitch",1,Q);selectInit("bitrate",[{str:32,value:32},{str:40,value:40},{str:48,value:48},{str:56,value:56},{str:64,value:64},{str:80,value:80},{str:96,value:96},{str:112,value:112},{str:128,value:128},{str:144,value:144},{str:160,value:160}],64);D.setValue(100);p&&1!=parseInt(p[uciAudioCapability.optName.mute])&&$("#speakerMute").parent().hide();c&&1!=parseInt(c[uciAudioCapability.optName.mute])&&$("#inputMute").parent().hide();c&&1!=parseInt(c[uciAudioCapability.optName.noiseEliminate])&&
$("#noiseSwitch").parent().hide();!0==g&&(r=l.mute,L.setState(r==q?1:0),C.setValue(l.volume),y=l.volume,B.resetSel(l.output_device_type),a=id("hidebgA"),n==r?(a.style.display="block",a.style.height=getoffset(id("speakerVolume")).top-getoffset(id("speakerMute")).top+"px"):a.style.display="none");G.resetSel(f.sampling_rate);H.resetSel(f.encode_type);A.resetSel(f.input_device_type);s=f.mute;M.setState(s==n?0:1);D.setValue(f.volume);w=f.volume;t=f.noise_cancelling;N.setState(t==n?1:0);I.resetSel(f.bitrate);
a=id("hidebg");n==s?(a.style.display="block",a.style.height=!0==g?getoffset(id("audioOutSetTitle")).top-getoffset(id("audioInput")).top+"px":getoffset(id("save")).top-getoffset(id("audioInput")).top+"px"):a.style.display="none";showDetailCon()})})()}init();
</script><style type="text/css">li.hidden{display:none!important}</style>