403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/simple_vad.min.js
(function(){if(BX.SimpleVAD){return}var t=.1;var e=2e3;var i=.5;BX.SimpleVAD=function(t){if(!(t.mediaStream instanceof MediaStream)){throw new Error("config.mediaStream should be instance of MediaStream")}if(t.mediaStream.getAudioTracks().length===0){throw new Error("config.mediaStream should contain audio track")}this.mediaStream=new MediaStream;this.mediaStream.addTrack(t.mediaStream.getAudioTracks()[0].clone());this.audioContext=null;this.mediaStreamNode=null;this.analyserNode=null;this.audioTimeDomainData=null;this.voiceState=false;this.measureInterval=0;this.inactivityTimeout=0;this.currentVolume=0;this.callbacks={voiceStarted:BX.type.isFunction(t.onVoiceStarted)?t.onVoiceStarted:BX.DoNothing,voiceStopped:BX.type.isFunction(t.onVoiceStopped)?t.onVoiceStopped:BX.DoNothing};if(BX.SimpleVAD.isSupported()){this.init()}};BX.SimpleVAD.isSupported=function(){return(window.AudioContext||window.webkitAudioContext)&&window.AnalyserNode&&typeof window.AnalyserNode.prototype["getFloatTimeDomainData"]==="function"};BX.SimpleVAD.prototype.init=function(){this.audioContext=new(window.AudioContext||window.webkitAudioContext);this.analyserNode=this.audioContext.createAnalyser();this.analyserNode.fftSize=128;this.mediaStreamNode=this.audioContext.createMediaStreamSource(this.mediaStream);this.mediaStreamNode.connect(this.analyserNode);this.audioTimeDomainData=new Float32Array(this.analyserNode.fftSize);this.measureInterval=setInterval(this.analyzeAudioStream.bind(this),100)};BX.SimpleVAD.prototype.analyzeAudioStream=function(){this.analyserNode.getFloatTimeDomainData(this.audioTimeDomainData);this.updateCurrentVolume(this.audioTimeDomainData);this.setVoiceState(this.currentVolume>=t)};BX.SimpleVAD.prototype.setVoiceState=function(t){if(this.voiceState==t){return}if(t){this.callbacks.voiceStarted();clearTimeout(this.inactivityTimeout);this.inactivityTimeout=0;this.voiceState=true}else{if(!this.inactivityTimeout){this.inactivityTimeout=setTimeout(this.onInactivityTimeout.bind(this),e)}}};BX.SimpleVAD.prototype.onInactivityTimeout=function(){this.inactivityTimeout=0;this.voiceState=false;this.callbacks.voiceStopped()};BX.SimpleVAD.prototype.updateCurrentVolume=function(t){var e=0;for(var a=0;a<t.length;a++){e+=t[a]*t[a]}var o=Math.sqrt(e/t.length);this.currentVolume=Math.max(o,this.currentVolume*i)};BX.SimpleVAD.prototype.destroy=function(){if(this.analyserNode){this.analyserNode.disconnect()}if(this.mediaStreamNode){this.mediaStreamNode.disconnect()}if(this.audioContext){this.audioContext.close()}if(this.mediaStream){this.mediaStream.getTracks().forEach(function(t){t.stop()});this.mediaStream=null}clearInterval(this.measureInterval);this.analyserNode=null;this.mediaStreamNode=null;this.audioContext=null;this.callbacks={voiceStarted:BX.DoNothing,voiceStopped:BX.DoNothing}}})();
//# sourceMappingURL=simple_vad.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit