@zoom/videosdk
Advanced tools
Comparing version 1.10.5 to 1.10.7
@@ -1,2 +0,2 @@ | ||
!function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=17)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(14);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}t.exports=function(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(16)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(t,e){function r(t,e,r,o,i,n,s){try{var a=t[n](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(o,i)}t.exports=function(t){return function(){var e=this,o=arguments;return new Promise((function(i,n){var s=t.apply(e,o);function a(t){r(s,i,n,a,u,"next",t)}function u(t){r(s,i,n,a,u,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e,o){return t.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default,i=r(6);t.exports=function(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(4),i=r(7),n=r(11),s=r(12);function a(e){var r="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!n(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return s(t,arguments,o(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,a(e)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(7),i=r(13);function n(e,r,s){return i()?(t.exports=n=Reflect.construct.bind(),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=n=function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&o(n,r.prototype),n},t.exports.__esModule=!0,t.exports.default=t.exports),n.apply(null,arguments)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default,i=r(15);t.exports=function(t){var e=i(t,"string");return"symbol"===o(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default;t.exports=function(t,e){if("object"!==o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default;function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof b?e:b,n=Object.create(i.prototype),a=new M(o||[]);return s(n,"_invoke",{value:T(t,r,a)}),n}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p={};function b(){}function _(){}function g(){}var y={};f(y,u,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(x([])));v&&v!==r&&n.call(v,u)&&(y=v);var A=g.prototype=b.prototype=Object.create(y);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;s(this,"_invoke",{value:function(i,s){function a(){return new e((function(r,a){!function r(i,s,a,u){var h=d(t[i],t,s);if("throw"!==h.type){var c=h.arg,f=c.value;return f&&"object"==o(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(h.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function T(t,e,r){var o="suspendedStart";return function(i,n){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===i)throw n;return L()}for(r.method=i,r.arg=n;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===p)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var u=d(t,e,r);if("normal"===u.type){if(o=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o="completed",r.method="throw",r.arg=u.arg)}}}function w(t,e){var r=e.method,o=t.iterator[r];if(void 0===o)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var n=i.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function x(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return _.prototype=g,s(A,"constructor",{value:g,configurable:!0}),s(g,"constructor",{value:_,configurable:!0}),_.displayName=f(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,f(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},S(E.prototype),f(E.prototype,h,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,o,i,n){void 0===n&&(n=Promise);var s=new E(l(t,r,o,i),n);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(A),f(A,c,"Generator"),f(A,u,(function(){return this})),f(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=x,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=void 0),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var a=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var i=o.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.r(e);var o=r(6),i=r.n(o),n=r(8),s=r.n(n),a=r(9),u=r.n(a),h=r(4),c=r.n(h),f=r(10),l=r.n(f),d=r(0),p=r.n(d),b=r(1),_=r.n(b),g=function(){function t(e){p()(this,t),this.messageQueue=[],this.audioDecodeWorkerPort=e,this.userAgent="",this.isSafari=!1,this.debug=this.debug.bind(this),this.log=this.log.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.print_=this.print_.bind(this)}return _()(t,[{key:"setUserAgent",value:function(t){this.userAgent=t,this.userAgent.match(/AppleWebKit\/(\d+)\./)&&(this.isSafari=!0)}},{key:"setAudioDecodeWorkerPort",value:function(t){this.audioDecodeWorkerPort=t}},{key:"debug",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"debug",message:t,data:r})}},{key:"log",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"log",message:t,data:r})}},{key:"warn",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"warn",message:t,data:r})}},{key:"error",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"error",message:t,data:r})}},{key:"print_",value:function(t){if(this.messageQueue.push(t),this.audioDecodeWorkerPort)for(;this.messageQueue.length;){var e=this.messageQueue.shift();this.isSafari||"error"===e.level?this._postToWorkerPrint(e):console[e.level](e.message,e.data)}}},{key:"_postToWorkerPrint",value:function(t){this.audioDecodeWorkerPort&&this.audioDecodeWorkerPort.postMessage({status:"workletMessage",data:{level:t.level,message:t.message,data:t.data}})}}]),t}(),y=function(t,e){this._BYTES_PER_ELEMENT=e,this.capacity=(t.byteLength-8)/e,this.usableCapacity=this.capacity-1,this.buf=t,this.write_ptr=new Uint32Array(this.buf,0,1),this.read_ptr=new Uint32Array(this.buf,4,1),this.storageUint8s=new Uint8Array(this.buf,8,t.byteLength-8)};y.prototype.available_read=function(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._available_read(t,e)},y.prototype._available_read=function(t,e){return(e+this.capacity-t)%this.capacity},y.prototype.dequeue=function(){var t=Atomics.load(this.read_ptr,0),e=new Uint32Array(this.buf,t*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+4,t*this._BYTES_PER_ELEMENT+4+e[0])},y.prototype.addReadPtr=function(){var t=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(t+1)%this.capacity)},y.prototype.getReaderPtr=function(){return this.read_ptr[0]},y.prototype.setReaderPtr=function(t){Atomics.store(this.read_ptr,0,t%this.capacity)},y.prototype.get=function(t){var e=t%this.capacity,r=new Uint32Array(this.buf,e*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(e*this._BYTES_PER_ELEMENT+4,e*this._BYTES_PER_ELEMENT+4+r[0])};var m=y,v=function(){function t(e,r){p()(this,t),this.rframes=e,this.wframes=r,this.cap=this.lcm(e,r),this.buffer=new Float32Array(this.cap),this.remain=0,this.woffset=0,this.roffset=0}return _()(t,[{key:"gcd",value:function(t,e){return 0===e?t:this.gcd(e,t%e)}},{key:"lcm",value:function(t,e){return t/this.gcd(t,e)*e}},{key:"push",value:function(t){if(t.length!=this.wframes)return console.error("[Audio] critical error in AudioWorklet: data.length:",t.length,"this.woffset:",this.woffset,"this.cap:",this.cap),void _workletPrinter.error({message:"[Audio] critical error in AudioWorklet: ".concat(t.length," ").concat(this.woffset," ").concat(this.cap)});this.buffer.set(t,this.woffset),this.woffset+=t.length,this.remain+=t.length,this.woffset>=this.cap&&(this.woffset=0)}},{key:"read",value:function(){if(!this.hasData())return null;var t=this.buffer.subarray(this.roffset,this.roffset+this.rframes);return this.remain-=this.rframes,this.roffset+=this.rframes,this.roffset>=this.cap&&(this.roffset=0),t}},{key:"hasData",value:function(){return this.remain>=this.rframes}}]),t}();r(3),r(2);function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)return e.postMessage({status:48,data:t});postMessage({status:48,data:t})}var S=function(){function t(){p()(this,t),this.ssrcInfoMap=new Map,this.timer=null}return _()(t,[{key:"updateSSRCInfo",value:function(t,e){this.ssrcInfoMap.has(t)||this.ssrcInfoMap.set(t,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(t,e),this._removeZeroFPS()}},{key:"_calculateFPS",value:function(t,e){var r=this.ssrcInfoMap.get(t);if(r.timeList.push(e),r.lastTime=e,r.timeList.length>2&&r.timeList.length%5==0){var o=r.timeList[0],i=r.timeList[r.timeList.length-1];if(i-o>=1e3){var n=Math.floor(1e3/((i-o)/(r.timeList.length-1)));r.fps!==n&&(this._notifyFPS(t,n),r.fps=n),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}},{key:"_removeZeroFPS",value:function(){var t=this;this.ssrcInfoMap.forEach((function(e,r){var o=t.ssrcInfoMap.get(r);o&&Date.now()-o.lastTime>2e3&&(t.ssrcInfoMap.delete(r),t._notifyFPS(r,0))}))}},{key:"_notifyFPS",value:function(t,e){postMessage({status:66.6,data:{ssrc:t,fps:e}})}},{key:"_checkIfNewFrameComing",value:function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((function(){t._removeZeroFPS(),t.timer=null}),2500)}}]),t}();new Map,new S;var E,T,w,P,k={WORKLET:1,ENCODE:2,DECODE:3},M=0;var x={WASMTYPE:k,onWasmModuleReady:function(t){if(!t)return console.warn("[AudioWASMAdapter] Module undefined");t.cwrap("_Heartbeat","number",["number"]),w=t.cwrap("_MuteUnmuteState","number",["number","number"]),P=t.cwrap("_Switch_Original_Sound","number",["number","boolean","boolean","boolean","boolean"])},setAudioInstanceAndType:function(t,e,r){E=t,e&&(M=e),r&&(T=r)},muteUnmuteState:function(t){E?(w(E,t),A("muteUnmuteState: "+t)):A("muteUnmuteState: -1")},onMonitorLogWASM:function(t,e){if(!(e<=0)){var r=Module.HEAPU8.subarray(t,t+e),o=String.fromCharCode.apply(null,r);o&&(M==k.ENCODE||M==k.DECODE?A(o):M==k.WORKLET&&T&&T.port&&A(o,T.port))}},onMuteSpeechWarningWASM:function(){postMessage({status:121})},onAudioLevelWASM:function(t,e,r){},switchOriginalSound:function(t,e,r,o){E&&P(E,t,e,r,o)}};function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=c()(t);if(e){var i=c()(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return u()(this,r)}}r.d(e,"Update_SSRC_Time",(function(){return nt})),r.d(e,"Get_SSRC_Latest_Time",(function(){return st})),globalThis.onerror=function(t){_workletPrinter.error(t.stack)},globalThis.onWasmModuleReady=function(){x.onWasmModuleReady(Module),H=Module.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number"]),(j=H(q,X,V,0,0,!0,!1,Q,1))?x.setAudioInstanceAndType(j,x.WASMTYPE.WORKLET,ct):g.error("audio_handle not exist"),Y=Module.cwrap("_Audio_Decode","number",["number","number","number","number"]),Z=Module.cwrap("_Get_Mixed_Audio","number",["number","number","number","number"]),Module.cwrap("_Update_Monitor_Send_Audio_Info","number",["number","number","number"]),Module.cwrap("_Update_Monitor_Receive_Audio_Info","number",["number","number","number"]),G=Module.cwrap("_setMultiViewFlag","number",["number","boolean"]),D=Module.cwrap("_Interpretation_Configure","number",["number","number","number","number"]),R=Module.cwrap("_Set_Speech_Volume_Level","number",["number","number","number"]),C=Module._malloc(4*rt),Module.HEAPU32.subarray(C/4,C/4+rt),G(j,J),I=Module._malloc(ot),Module.HEAP8.subarray(I,I+ot),ct.port.postMessage({status:"WASM_INIT_SUCCESS",data:{audio_handle:0!==j}})},globalThis.onAbort=function(t){_workletPrinter.error("WASM onAbort "+(t?t.message:""),t)},globalThis.preInit=function(t){_workletPrinter.debug("WASM preInit"+(t?t.message:""),t)},globalThis.preRun=function(t){_workletPrinter.debug("WASM preRun"+(t?t.message:""),t)},globalThis._workletPrinter=new g,globalThis.AudioWasmAdapter=x;var D,C,R,I,O=function(){function t(){p()(this,t),this.cacheSize=0,this.sameCacheSizeCounter=0}return _()(t,[{key:"shouldSendCacheSize",value:function(t){return t===this.cacheSize&&this.sameCacheSizeCounter++,(this.cacheSize!==t||200===this.sameCacheSizeCounter)&&(this.sameCacheSizeCounter=0,this.cacheSize=t,!0)}}]),t}(),B=function(){function t(){p()(this,t),this.buffList=[],this.cacheMinSize=4,this.cacheMaxSize=16,this.cacheSize=this.cacheMinSize,this.onCacheSizeChange=null,this.onrollbackbuffer=null,this.onneedmoredata=null,this.isReady=!1,this.cacheSizeController=new O}return _()(t,[{key:"push",value:function(t){this.isReady=!0,this.buffList.push({buff:t,offset:0})}},{key:"copy",value:function(t,e,r,o){return t.length-e<=r.length-o?(0===e?r.set(t,o):r.set(t.subarray(e),o),t.length-e):(r.set(t.subarray(e,e+r.length-o),o),r.length-o)}},{key:"increaseCacheSize",value:function(){this.isReady&&this.cacheSize++,this.cacheSize>this.cacheMaxSize&&(this.cacheSize=this.cacheMaxSize),this.onCacheSizeChange&&this.isReady&&this.cacheSizeController.shouldSendCacheSize(this.cacheSize)&&this.onCacheSizeChange(this.cacheSize)}},{key:"copyTo",value:function(t){if(0===this.buffList.length)return t.fill(0),void this.increaseCacheSize();var e=this.buffList[0];if(e.buff.length-e.offset>=t.length)this.copy(e.buff,e.offset,t,0),e.offset+=t.length,e.offset===e.buff.length&&(this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff));else{if(this.buffList.length<2)return t.fill(0),void this.increaseCacheSize();var r=this.copy(e.buff,e.offset,t,0);this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff),e=this.buffList[0],r=this.copy(e.buff,e.offset,t,r),e.offset+=r}}},{key:"requestMoreData",value:function(){this.buffList.length<this.cacheSize&&this.onneedmoredata&&this.onneedmoredata()}},{key:"hasData",value:function(){return this.buffList.length>=2}}]),t}(),N=function(){function t(e){p()(this,t),this.buffList=[],this.frameLength=e,this.onframedata=null}return _()(t,[{key:"copy",value:function(t,e,r,o){if(t[0].length*$<=r.length-o){for(var i=0;i<$;i++)for(var n=0;t[i]&&n<t[i].length;n++)r[o+n*$+i]=t[i][n];return(t[0].length-e)*$}for(var s=0;s<$;s++)for(var a=0;t[s]&&a<t[s].length&&o+a*$+s<r.length;a++)r[o+a*$+s]=t[s][a];return r.length-o}},{key:"rollbackbuffer",value:function(t){this.buffList.push({buff:t,offset:0})}},{key:"push",value:function(t){0===this.buffList.length&&this.buffList.push({buff:new Float32Array(this.frameLength),offset:0});var e=this.buffList[0];if(e.buff.length-e.offset>=t[0].length*$){var r=this.copy(t,0,e.buff,e.offset);e.offset+=r,e.buff.length===e.offset&&(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff))}else{var o=this.copy(t,0,e.buff,e.offset);if(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff),t[0].length*$>o){for(var i=[],n=0;n<$;n++)i.push(t[n].subarray(Math.floor(o/$)+(o%$>n?1:0)));this.push(i)}}}}]),t}(),U=function(){function t(e,r){var o=this;p()(this,t),this.context=r,this.decodePort=null,this.encodePort=null,this.captureSize=e/100*$,this.playBuffer=new B,this.playBuffer.onrollbackbuffer=function(t){o.decodePort},this.playBuffer.onneedmoredata=function(){o.decodePort&&o.decodePort.postMessage({status:1})},this.playBuffer.onCacheSizeChange=function(t){o.decodePort&&o.decodePort.postMessage({status:3,cacheSize:t})},this.quantum=new Float32Array(128*tt),this.captureBuffer=new N(this.captureSize),this.captureBuffer.onframedata=function(t){o.encodePort&&o.encodePort.postMessage({command:2,buffer:t},[t.buffer])}}return _()(t,[{key:"setDecodePort",value:function(t){this.decodePort&&this.decodePort.close(),this.decodePort=t,this.decodePort.onmessage=this.handleDecodeData.bind(this)}},{key:"setEncodePort",value:function(t){this.encodePort&&this.encodePort.close(),this.encodePort=t,this.encodePort.onmessage=this.handleEncodeData.bind(this)}},{key:"handleDecodeData",value:function(t){this.context.isPlaying&&this.playBuffer.push(t.data.data)}},{key:"handleEncodeData",value:function(t){switch(t.data.event){case 0:this.captureBuffer.rollbackbuffer(t.data.buffer)}}},{key:"requestMoreData",value:function(){this.playBuffer.requestMoreData()}},{key:"close",value:function(){this.decodePort&&(this.decodePort=null,this.decodePort.close()),this.encodePort&&(this.encodePort=null,this.encodePort.close())}},{key:"write",value:function(t){this.captureBuffer.push(t)}},{key:"read",value:function(){return this.playBuffer.copyTo(this.quantum),this.requestMoreData(),this.quantum}}]),t}(),W=function(){function t(e,r,o){if(p()(this,t),this.STATE_READ_READY=0,this.STATE_READ_INDEX=1,this.STATE_WRITE_READY=2,this.STATE_WRITE_INDEX=3,this.STATE_DATA_COUNT=4,this.STATE_CACHE_SIZE=5,this.STATY_READY_NO=0,this.STATY_READY_YES=1,this.sabState=new Uint32Array(e),this.sabBuffer=new Float32Array(r),this.perFrameLength=o,this.bufferLen=this.sabBuffer.length,this.supportSpecialOptimization=this.bufferLen%o==0,this.bufferIndex=null,this.supportSpecialOptimization){var i=this.bufferLen/o;this.bufferIndex=[];for(var n=0;n<i;n++)this.bufferIndex.push(this.sabBuffer.subarray(n*o,n*o+o))}this.placeBuffer=new Float32Array(this.perFrameLength),this.QUANTUM_SIZE=128,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MIN_VALUE=6,this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE),this.setCacheSize(this.CACHE_SIZE_MIN_VALUE),this._counter=0,this.onCacheSizeChange=null,this.cacheSizeController=new O}return _()(t,[{key:"getCacheSize",value:function(){return Atomics.load(this.sabState,this.STATE_CACHE_SIZE)}},{key:"setCacheSize",value:function(t){t>this.CACHE_SIZE_MAX_VALUE&&(t=this.CACHE_SIZE_MAX_VALUE),t<this.CACHE_SIZE_MIN_VALUE&&(t=this.CACHE_SIZE_MIN_VALUE),this.onCacheSizeChange&&this.cacheSizeController.shouldSendCacheSize(t)&&this.onCacheSizeChange(t),Atomics.store(this.sabState,this.STATE_CACHE_SIZE,t)}},{key:"setQuantumSize",value:function(t){this.QUANTUM_SIZE=t,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE)}},{key:"isNeedMoreData",value:function(){var t=Atomics.load(this.sabState,this.STATE_CACHE_SIZE);return Atomics.load(this.sabState,this.STATE_DATA_COUNT)<t*this.QUANTUM_SIZE}},{key:"shouldAdjustCacheBuffer",value:function(){this._counter>0&&this.setCacheSize(this.getCacheSize()+1)}},{key:"clear",value:function(){this.sabState&&(this.sabState[this.STATE_READ_READY]=0,this.sabState[this.STATE_READ_INDEX]=0,this.sabState[this.STATE_WRITE_READY]=0,this.sabState[this.STATE_WRITE_INDEX]=0,this.sabState[this.STATE_DATA_COUNT]=0),this._counter=0}},{key:"setWriteReady",value:function(){this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES}},{key:"isReady",value:function(){return this.sabState[this.STATE_WRITE_READY]&&this.sabState[this.STATE_READ_READY]}},{key:"getDataCount",value:function(){return Atomics.load(this.sabState,this.STATE_DATA_COUNT)}},{key:"write",value:function(t){if(t[0].length*$===this.perFrameLength){var e=this.sabState[this.STATE_READ_READY];if(this.sabState[this.STATE_WRITE_READY]||(this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES,this.sabState[this.STATE_WRITE_INDEX]=0),e)return this.supportSpecialOptimization?this.writeSpecial(t):this.writeNormal(t)}}},{key:"writeNormal",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<$;r++)for(var o=0;t[r]&&o<t[r].length;o++)this.sabBuffer[(e+o*$+r)%this.bufferLen]=t[r][o];(e+=this.perFrameLength)>=this.bufferLen&&(e-=this.bufferLen),this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"writeSpecial",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<$;r++)for(var o=0;t[r]&&o<t[r].length;o++)this.bufferIndex[e][o*$+r]=t[r][o];e=(e+1)%this.bufferIndex.length,this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"read",value:function(){var t=this.sabState[this.STATE_READ_READY],e=this.sabState[this.STATE_WRITE_READY];if(t||(this.sabState[this.STATE_READ_READY]=this.STATY_READY_YES,this.sabState[this.STATE_READ_INDEX]=0),!e)return null;var r=this.supportSpecialOptimization?this.readSpecial():this.readNormal();return null===r?this.shouldAdjustCacheBuffer():this._counter++,r}},{key:"readNormal",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r*this.perFrameLength+t)%this.bufferLen,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var o=null;if(this.bufferLen-t>=this.perFrameLength)o=this.sabBuffer.subarray(t,t+this.perFrameLength);else{var i=this.sabBuffer.subarray(t),n=this.sabBuffer.subarray(0,this.perFrameLength-i.length);(o=this.placeBuffer).set(i),o.set(n,i.length)}return(t+=this.perFrameLength)>=this.bufferLen&&(t-=this.bufferLen),this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),o}},{key:"readSpecial",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r+t)%this.bufferIndex.length,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var o=this.bufferIndex[t];return t=(t+1)%this.bufferIndex.length,this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),o}}]),t}(),z="undefined"!=typeof SharedArrayBuffer,F=!0,H=null,Y=null,j=null,Z=null,G=null,V=0,X=0,Q=!1,q=0,K=0,J=!1,$=1,tt=1,et=null,rt=10,ot=1500,it=new Map;function nt(t){if(t){var e=t.length/16,r=0,o=0;for(r=0;r<e;r++){var i=0;for(o=16*r+0;o<16*r+4;o++)i+=t[o]*Math.pow(256,o-16*r);i>>=10;var n=0;for(o=16*r+4;o<16*r+12;o++)n+=t[o]*Math.pow(256,o-16*r-4);it.set(i,n)}}}function st(t){t>>=10;var e=it.get(t);return e?(it.set(t,0),e):0}function at(t){var e=t[1];return 4294967296*t[2]+e}globalThis.update_play_time=function(t,e){if(e){var r=new Uint8Array(e),o=Module.HEAP8.subarray(t+0,t+e);if(r.set(o),J){var i;null===(i=ct.videoDecodePort)||void 0===i||i.postMessage({status:1,data:r},[r.buffer])}else{for(var n=new Uint32Array(r.buffer),s=0,a=0,u=0;u<r.length/16;u++){var h=n[4*u];512&h?a=at(n.subarray(4*u,4*u+4)):h>>10==K>>10&&(s=at(n.subarray(4*u,4*u+4)))}if(!s&&!a)return;ct.port.postMessage({status:57,at:s,st:a})}}};var ut=null,ht=null;globalThis.frame_callback=function(t,e,r,o,i,n,s,a){ut===t&&ht.length==e*s||(ht=Module.HEAPF32.subarray(t/4,t/4+e*s),ut=t),et.push(ht)};var ct=null;var ft=function(t){s()(r,t);var e=L(r);function r(t){var o,n,s;return p()(this,r),s=e.call(this),ct=i()(s),monitorLOG("WIB"),s.port.onmessage=s.handleMessage.bind(i()(s)),s.isPlaying=!1,s.isCapturing=!1,s.wasmModule=null==t||null===(o=t.processorOptions)||void 0===o?void 0:o.wasmModule,t&&t.processorOptions&&(t.processorOptions.audioEncodeChannelsNum&&($=t.processorOptions.audioEncodeChannelsNum),t.processorOptions.audioDecodeChannelsNum&&(tt=t.processorOptions.audioDecodeChannelsNum)),s.SABConstructor(t&&t.processorOptions?t.processorOptions.sharedBuffer:null),s.noSABConstructor(),globalThis.fsHandler&&globalThis.fsHandler.setPort(s.port),null!=t&&null!==(n=t.processorOptions)&&void 0!==n&&n.userAgent&&_workletPrinter.setUserAgent(t.processorOptions.userAgent),monitorLOG("WIE"),s}return _()(r,[{key:"SABConstructor",value:function(t){this.sampleRate_=0,this.g_sharedbuffer=t||null,this.encodeSAB=null,this.decodeSAB=null,this.audioEncodePort=null,this.audioDecodePort=null,this.videoDecodePort=null,this.rtpSAB=null,this.stopPlayAudio=!1,et=new v(128*tt,sampleRate/100*tt)}},{key:"noSABConstructor",value:function(){this.audioProcessBuffer=new U(sampleRate,this),this.isRunning=!0}},{key:"handleMessage",value:function(t){var e=t.data,r=e.status,o=e.data;switch(r){case"diableSharedArrayBuffer":z=!1;break;case"disableDecoderinworklet":F=!1;break;case"data":console.info("Dropped audio data before initialized");break;case"stopPlayAudio":this.isPlaying=!1;break;case"stopWorklet":dt=!0;break;case"startPlayAudio":this.isPlaying=!0;break;case"StartCaptureAudio":this.isCapturing=!0;break;case"sampleRate":this.sampleRate_=o;break;case"audiowasm":try{initWasm(Module,this.wasmModule)}catch(t){_workletPrinter.error("init WASM failed, error message:"+t.message+t.stack)}break;case"initData":q=o.userid,V=o.meetingid,X=o.meetingnum,Q=o.qoson;break;case"currentSSRC":K=o;break;case"stop_audio_incoming":this.stopPlayAudio=o;break;case"codecDoAVSync":J=!0,G&&j&&G(j,!0);break;case"checkProcess":monitorLOG("PCC"+pt),pt=0;break;case"interpretation_set_lang":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.lang,D(j,1,C,1);break;case"interpretation_enable":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.enable?1:0,D(j,0,C,1);break;case"interpretation_mute_origin":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.mute?1:0,D(j,2,C,1);break;case"interpretation_set_interpreter":var i=Module.HEAPU32.subarray(C/4,C/4+rt),n=C;o.interpreterList.length>=rt&&(n=Module._malloc(4*o.interpreterList.length),i=Module.HEAPU32.subarray(n/4,n/4+o.interpreterList.length));for(var s=0;s<o.interpreterList.length;s++)i[s]=o.interpreterList[s];D(j,3,n,o.interpreterList.length),o.interpreterList.length>=rt&&Module._free(n);break;case"setSpeechVolumeLevel":if(!j)return;R(j,o.userid,o.volume);break;default:z?this.handleMessageForSAB(t):this.handleMessageForNoSAB(t)}}},{key:"handleMessageForSAB",value:function(t){var e=this,r=t.data,o=r.status,i=r.data;switch(o){case"encodeAudioPort":this.audioEncodePort&&this.audioEncodePort.close(),this.audioEncodePort=t.ports[0];break;case"decodeAudioPort":this.audioDecodePort&&this.audioDecodePort.close(),this.audioDecodePort=t.ports[0],_workletPrinter.setAudioDecodeWorkerPort(t.ports[0]),this.audioDecodePort.onmessage=function(t){};break;case"decodeVideoPort":this.videoDecodePort&&this.videoDecodePort.close(),this.videoDecodePort=t.ports[0];break;case"close":break;case"sharedBuffer":i&&(this.g_sharedbuffer=i),this.g_sharedbuffer&&(this.encodeSAB=new W(this.g_sharedbuffer.inputState,this.g_sharedbuffer.inputBuffer,128*$),this.decodeSAB=new W(this.g_sharedbuffer.outputState,this.g_sharedbuffer.outputBuffer,128*tt),this.rtpSAB=new m(this.g_sharedbuffer.rtpBuffer,1200),this.decodeSAB.onCacheSizeChange=function(t){e.audioDecodePort&&e.audioDecodePort.postMessage({status:3,cacheSize:t,isSAB:!0})});break;default:console.warn("unhanle commands in audioworklet",o)}}},{key:"handleMessageForNoSAB",value:function(t){var e=t.data.status;switch(e){case"encodeAudioPort":this.audioProcessBuffer.setEncodePort(t.ports[0]);break;case"decodeAudioPort":_workletPrinter.setAudioDecodeWorkerPort(t.ports[0]),this.audioProcessBuffer.setDecodePort(t.ports[0]);break;case"close":this.audioProcessBuffer.close(),this.isPlaying=!1,this.isRunning=!1;break;default:console.warn("unhanle commands in audioworklet",e)}}},{key:"onReceivedRTP",value:function(){}},{key:"process",value:function(t,e,r){if(pt++,dt)return!1;try{return z?F?this.SABDecodeProcess(t,e,r):this.SABProcess(t,e,r):this.NoSABprocess(t,e,r)}catch(t){return _workletPrinter.error("::process() exception: "+t.message+t.stack),!0}}},{key:"NoSABprocess",value:function(t,e,r){return!!this.isRunning&&(!this.isPlaying||(this.inputDataForNoSAB(t),this.outputDataForNoSAB(e),!0))}},{key:"inputDataForNoSAB",value:function(t){if(!t[0]||!t[0][0])return!0;this.audioProcessBuffer.write(t[0])}},{key:"outputDataForNoSAB",value:function(t){var e=this.audioProcessBuffer.read();if(this.stopPlayAudio)return!0;var r=t[0];if(1===tt)for(var o=0;o<r.length;o++)r[o].set(e);else for(var i=0;i<tt;i++)for(var n=0;r[i]&&n<r[i].length;n++)r[i][n]=e[n*tt+i]}},{key:"inputData",value:function(t){if(!this.encodeSAB)return!0;this.encodeSAB.write(t),this.audioEncodePort.postMessage({command:2,buffer:!1})}},{key:"outputDecodeData",value:function(t){try{et.hasData()||Z&&(sampleRate!=lt&&(globalThis.sampleRateLog(lt,sampleRate,"","",3),lt=sampleRate),Z(j,sampleRate/100,0,sampleRate,tt))}catch(t){_workletPrinter.error("::outputDecodeData() get_mixed_Audio exception: "+t.message+t.stack)}try{var e=et.read();if(!e)return;if(1===tt)for(var r=0;r<t.length;r++)t[r].set(e);else for(var o=0;o<tt;o++)for(var i=0;t[o]&&i<t[o].length;i++)t[o][i]=e[i*tt+o]}catch(t){_workletPrinter.error("::outputDecodeData() set outputs exception: "+t.message+t.stack)}}},{key:"outputData",value:function(t){if(!this.decodeSAB)return!0;var e=this.decodeSAB.read();if(null===e||this.stopPlayAudio)return!0;if(1===tt)for(var r=0;r<t.length;r++)t[r].set(e);else for(var o=0;o<tt;o++)for(var i=0;t[o]&&i<t[o].length;i++)t[o][i]=e[i*tt+o]}},{key:"SABDecodeProcess",value:function(t,e,r){try{if(!this.rtpSAB)return globalThis.monitorLOG("SABN"),!0;var o=this.rtpSAB.available_read();o>100&&(o=100);for(var i=this.rtpSAB.getReaderPtr(),n=0;n<o;){n++;var s=this.rtpSAB.get(i);i++,j&&(Module.HEAP8.subarray(I,I+ot).set(s),Y(j,0,I,s.length))}this.rtpSAB.setReaderPtr(i)}catch(t){_workletPrinter.error("::SABDecodeProcess() audio_decode exception: "+t.message+t.stack)}try{var a=t[0],u=e[0];return!this.g_sharedbuffer||(!this.sampleRate_||!u[0]||(a[0]&&this.isCapturing&&this.inputData(a),this.outputDecodeData(u),!0))}catch(t){_workletPrinter.error("::SABDecodeProcess() inputs or outputs exception: "+t.message+t.stack)}return!0}},{key:"SABProcess",value:function(t,e,r){var o=t[0],i=e[0];return!this.g_sharedbuffer||(!this.sampleRate_||!i[0]||(o[0]&&this.isCapturing&&this.inputData(o),this.outputData(i),!0))}}],[{key:"parameterDescriptors",get:function(){return[{name:"pcm",defaultValue:1}]}}]),r}(l()(AudioWorkletProcessor)),lt=0,dt=!1,pt=0;globalThis.LOG_OUT=function(){},globalThis.fsHandler?(globalThis.LOG_OUT_WEBRTC=globalThis.fsHandler.handleFile,globalThis.Get_ExternalRecord=globalThis.fsHandler.handleViperPrint):(globalThis.LOG_OUT_WEBRTC=function(){},globalThis.Get_ExternalRecord=function(){}),globalThis.send_data=function(){},globalThis.monitorLOG=function(t){t&&ct.port.postMessage({status:"MONITOR_LOG",data:t})},globalThis.sampleRateLog=function(t,e,r,o,i){if(t||e){var n=null;switch(i){case 1:n="GGDS: ";break;case 2:n="SCAG: ";break;case 3:n="SCIW: "}var s=n+t+"|"+e+"|"+r+"|"+o;globalThis.monitorLOG(s)}},globalThis.wcl_trace_log=function(t,e){globalThis.fsHandler&&globalThis.fsHandler.handleAudioSDKUtilPrint(t,e)},registerProcessor("zoomAudioWorklet",ft)}]); | ||
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_audio_worklet.min.js-5e5c1c465575befb41de.map | ||
!function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=17)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(14);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}t.exports=function(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(16)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(t,e){function r(t,e,r,o,i,n,s){try{var a=t[n](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(o,i)}t.exports=function(t){return function(){var e=this,o=arguments;return new Promise((function(i,n){var s=t.apply(e,o);function a(t){r(s,i,n,a,u,"next",t)}function u(t){r(s,i,n,a,u,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e,o){return t.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default,i=r(6);t.exports=function(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(4),i=r(7),n=r(11),s=r(12);function a(e){var r="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!n(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return s(t,arguments,o(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,a(e)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(7),i=r(13);function n(e,r,s){return i()?(t.exports=n=Reflect.construct.bind(),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=n=function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&o(n,r.prototype),n},t.exports.__esModule=!0,t.exports.default=t.exports),n.apply(null,arguments)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default,i=r(15);t.exports=function(t){var e=i(t,"string");return"symbol"===o(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default;t.exports=function(t,e){if("object"!==o(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var o=r(5).default;function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof b?e:b,n=Object.create(i.prototype),a=new M(o||[]);return s(n,"_invoke",{value:T(t,r,a)}),n}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p={};function b(){}function _(){}function g(){}var y={};f(y,u,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(x([])));v&&v!==r&&n.call(v,u)&&(y=v);var A=g.prototype=b.prototype=Object.create(y);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;s(this,"_invoke",{value:function(i,s){function a(){return new e((function(r,a){!function r(i,s,a,u){var h=d(t[i],t,s);if("throw"!==h.type){var c=h.arg,f=c.value;return f&&"object"==o(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(h.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function T(t,e,r){var o="suspendedStart";return function(i,n){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===i)throw n;return L()}for(r.method=i,r.arg=n;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===p)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var u=d(t,e,r);if("normal"===u.type){if(o=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o="completed",r.method="throw",r.arg=u.arg)}}}function w(t,e){var r=e.method,o=t.iterator[r];if(void 0===o)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var n=i.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function x(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return _.prototype=g,s(A,"constructor",{value:g,configurable:!0}),s(g,"constructor",{value:_,configurable:!0}),_.displayName=f(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,f(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},S(E.prototype),f(E.prototype,h,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,o,i,n){void 0===n&&(n=Promise);var s=new E(l(t,r,o,i),n);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(A),f(A,c,"Generator"),f(A,u,(function(){return this})),f(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=x,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=void 0),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var a=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var i=o.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.r(e);var o=r(6),i=r.n(o),n=r(8),s=r.n(n),a=r(9),u=r.n(a),h=r(4),c=r.n(h),f=r(10),l=r.n(f),d=r(0),p=r.n(d),b=r(1),_=r.n(b),g=function(){function t(e){p()(this,t),this.messageQueue=[],this.audioDecodeWorkerPort=e,this.userAgent="",this.isSafari=!1,this.debug=this.debug.bind(this),this.log=this.log.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.print_=this.print_.bind(this)}return _()(t,[{key:"setUserAgent",value:function(t){this.userAgent=t,this.userAgent.match(/AppleWebKit\/(\d+)\./)&&(this.isSafari=!0)}},{key:"setAudioDecodeWorkerPort",value:function(t){this.audioDecodeWorkerPort=t}},{key:"debug",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"debug",message:t,data:r})}},{key:"log",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"log",message:t,data:r})}},{key:"warn",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"warn",message:t,data:r})}},{key:"error",value:function(t){t="[Audio][Worklet]"+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];this.print_({level:"error",message:t,data:r})}},{key:"print_",value:function(t){if(this.messageQueue.push(t),this.audioDecodeWorkerPort)for(;this.messageQueue.length;){var e=this.messageQueue.shift();this.isSafari||"error"===e.level?this._postToWorkerPrint(e):console[e.level](e.message,e.data)}}},{key:"_postToWorkerPrint",value:function(t){this.audioDecodeWorkerPort&&this.audioDecodeWorkerPort.postMessage({status:"workletMessage",data:{level:t.level,message:t.message,data:t.data}})}}]),t}(),y=function(t,e){this._BYTES_PER_ELEMENT=e,this.capacity=(t.byteLength-8)/e,this.usableCapacity=this.capacity-1,this.buf=t,this.write_ptr=new Uint32Array(this.buf,0,1),this.read_ptr=new Uint32Array(this.buf,4,1),this.storageUint8s=new Uint8Array(this.buf,8,t.byteLength-8)};y.prototype.available_read=function(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._available_read(t,e)},y.prototype._available_read=function(t,e){return(e+this.capacity-t)%this.capacity},y.prototype.dequeue=function(){var t=Atomics.load(this.read_ptr,0),e=new Uint32Array(this.buf,t*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+4,t*this._BYTES_PER_ELEMENT+4+e[0])},y.prototype.addReadPtr=function(){var t=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(t+1)%this.capacity)},y.prototype.getReaderPtr=function(){return this.read_ptr[0]},y.prototype.setReaderPtr=function(t){Atomics.store(this.read_ptr,0,t%this.capacity)},y.prototype.get=function(t){var e=t%this.capacity,r=new Uint32Array(this.buf,e*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(e*this._BYTES_PER_ELEMENT+4,e*this._BYTES_PER_ELEMENT+4+r[0])};var m=y,v=function(){function t(e,r){p()(this,t),this.rframes=e,this.wframes=r,this.cap=this.lcm(e,r),this.buffer=new Float32Array(this.cap),this.remain=0,this.woffset=0,this.roffset=0}return _()(t,[{key:"gcd",value:function(t,e){return 0===e?t:this.gcd(e,t%e)}},{key:"lcm",value:function(t,e){return t/this.gcd(t,e)*e}},{key:"push",value:function(t){if(t.length!=this.wframes)return console.error("[Audio] critical error in AudioWorklet: data.length:",t.length,"this.woffset:",this.woffset,"this.cap:",this.cap),void _workletPrinter.error({message:"[Audio] critical error in AudioWorklet: ".concat(t.length," ").concat(this.woffset," ").concat(this.cap)});this.buffer.set(t,this.woffset),this.woffset+=t.length,this.remain+=t.length,this.woffset>=this.cap&&(this.woffset=0)}},{key:"read",value:function(){if(!this.hasData())return null;var t=this.buffer.subarray(this.roffset,this.roffset+this.rframes);return this.remain-=this.rframes,this.roffset+=this.rframes,this.roffset>=this.cap&&(this.roffset=0),t}},{key:"hasData",value:function(){return this.remain>=this.rframes}}]),t}();r(3),r(2);function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)return e.postMessage({status:48,data:t});postMessage({status:48,data:t})}var S=function(){function t(){p()(this,t),this.ssrcInfoMap=new Map,this.timer=null}return _()(t,[{key:"updateSSRCInfo",value:function(t,e){this.ssrcInfoMap.has(t)||this.ssrcInfoMap.set(t,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(t,e),this._removeZeroFPS()}},{key:"_calculateFPS",value:function(t,e){var r=this.ssrcInfoMap.get(t);if(r.timeList.push(e),r.lastTime=e,r.timeList.length>2&&r.timeList.length%5==0){var o=r.timeList[0],i=r.timeList[r.timeList.length-1];if(i-o>=1e3){var n=Math.floor(1e3/((i-o)/(r.timeList.length-1)));r.fps!==n&&(this._notifyFPS(t,n),r.fps=n),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}},{key:"_removeZeroFPS",value:function(){var t=this;this.ssrcInfoMap.forEach((function(e,r){var o=t.ssrcInfoMap.get(r);o&&Date.now()-o.lastTime>2e3&&(t.ssrcInfoMap.delete(r),t._notifyFPS(r,0))}))}},{key:"_notifyFPS",value:function(t,e){postMessage({status:66.6,data:{ssrc:t,fps:e}})}},{key:"_checkIfNewFrameComing",value:function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((function(){t._removeZeroFPS(),t.timer=null}),2500)}}]),t}();new Map,new S;var E,T,w,P,k={WORKLET:1,ENCODE:2,DECODE:3},M=0;var x={WASMTYPE:k,onWasmModuleReady:function(t){if(!t)return console.warn("[AudioWASMAdapter] Module undefined");t.cwrap("_Heartbeat","number",["number"]),w=t.cwrap("_MuteUnmuteState","number",["number","number"]),P=t.cwrap("_Switch_Original_Sound","number",["number","boolean","boolean","boolean","boolean"])},setAudioInstanceAndType:function(t,e,r){E=t,e&&(M=e),r&&(T=r)},muteUnmuteState:function(t){E?(w(E,t),A("muteUnmuteState: "+t)):A("muteUnmuteState: -1")},onMonitorLogWASM:function(t,e){if(!(e<=0)){var r=Module.HEAPU8.subarray(t,t+e),o=String.fromCharCode.apply(null,r);o&&(M==k.ENCODE||M==k.DECODE?A(o):M==k.WORKLET&&T&&T.port&&A(o,T.port))}},onMuteSpeechWarningWASM:function(){postMessage({status:121})},onAudioLevelWASM:function(t,e,r){},switchOriginalSound:function(t,e,r,o){E&&P(E,t,e,r,o)}};function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=c()(t);if(e){var i=c()(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return u()(this,r)}}r.d(e,"Update_SSRC_Time",(function(){return nt})),r.d(e,"Get_SSRC_Latest_Time",(function(){return st})),globalThis.onerror=function(t){_workletPrinter.error(t.stack)},globalThis.onWasmModuleReady=function(){x.onWasmModuleReady(Module),H=Module.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number"]),(j=H(q,X,V,0,0,!0,!1,Q,1))?x.setAudioInstanceAndType(j,x.WASMTYPE.WORKLET,ct):_workletPrinter.error("audio_handle not exist"),Y=Module.cwrap("_Audio_Decode","number",["number","number","number","number"]),Z=Module.cwrap("_Get_Mixed_Audio","number",["number","number","number","number"]),Module.cwrap("_Update_Monitor_Send_Audio_Info","number",["number","number","number"]),Module.cwrap("_Update_Monitor_Receive_Audio_Info","number",["number","number","number"]),G=Module.cwrap("_setMultiViewFlag","number",["number","boolean"]),D=Module.cwrap("_Interpretation_Configure","number",["number","number","number","number"]),R=Module.cwrap("_Set_Speech_Volume_Level","number",["number","number","number"]),C=Module._malloc(4*rt),Module.HEAPU32.subarray(C/4,C/4+rt),G(j,J),I=Module._malloc(ot),Module.HEAP8.subarray(I,I+ot),ct.port.postMessage({status:"WASM_INIT_SUCCESS",data:{audio_handle:0!==j}})},globalThis.onAbort=function(t){_workletPrinter.error("WASM onAbort "+(t?t.message:""),t)},globalThis.preInit=function(t){_workletPrinter.debug("WASM preInit"+(t?t.message:""),t)},globalThis.preRun=function(t){_workletPrinter.debug("WASM preRun"+(t?t.message:""),t)},globalThis._workletPrinter=new g,globalThis.AudioWasmAdapter=x;var D,C,R,I,O=function(){function t(){p()(this,t),this.cacheSize=0,this.sameCacheSizeCounter=0}return _()(t,[{key:"shouldSendCacheSize",value:function(t){return t===this.cacheSize&&this.sameCacheSizeCounter++,(this.cacheSize!==t||200===this.sameCacheSizeCounter)&&(this.sameCacheSizeCounter=0,this.cacheSize=t,!0)}}]),t}(),B=function(){function t(){p()(this,t),this.buffList=[],this.cacheMinSize=4,this.cacheMaxSize=16,this.cacheSize=this.cacheMinSize,this.onCacheSizeChange=null,this.onrollbackbuffer=null,this.onneedmoredata=null,this.isReady=!1,this.cacheSizeController=new O}return _()(t,[{key:"push",value:function(t){this.isReady=!0,this.buffList.push({buff:t,offset:0})}},{key:"copy",value:function(t,e,r,o){return t.length-e<=r.length-o?(0===e?r.set(t,o):r.set(t.subarray(e),o),t.length-e):(r.set(t.subarray(e,e+r.length-o),o),r.length-o)}},{key:"increaseCacheSize",value:function(){this.isReady&&this.cacheSize++,this.cacheSize>this.cacheMaxSize&&(this.cacheSize=this.cacheMaxSize),this.onCacheSizeChange&&this.isReady&&this.cacheSizeController.shouldSendCacheSize(this.cacheSize)&&this.onCacheSizeChange(this.cacheSize)}},{key:"copyTo",value:function(t){if(0===this.buffList.length)return t.fill(0),void this.increaseCacheSize();var e=this.buffList[0];if(e.buff.length-e.offset>=t.length)this.copy(e.buff,e.offset,t,0),e.offset+=t.length,e.offset===e.buff.length&&(this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff));else{if(this.buffList.length<2)return t.fill(0),void this.increaseCacheSize();var r=this.copy(e.buff,e.offset,t,0);this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff),e=this.buffList[0],r=this.copy(e.buff,e.offset,t,r),e.offset+=r}}},{key:"requestMoreData",value:function(){this.buffList.length<this.cacheSize&&this.onneedmoredata&&this.onneedmoredata()}},{key:"hasData",value:function(){return this.buffList.length>=2}}]),t}(),N=function(){function t(e){p()(this,t),this.buffList=[],this.frameLength=e,this.onframedata=null}return _()(t,[{key:"copy",value:function(t,e,r,o){if(t[0].length*$<=r.length-o){for(var i=0;i<$;i++)for(var n=0;t[i]&&n<t[i].length;n++)r[o+n*$+i]=t[i][n];return(t[0].length-e)*$}for(var s=0;s<$;s++)for(var a=0;t[s]&&a<t[s].length&&o+a*$+s<r.length;a++)r[o+a*$+s]=t[s][a];return r.length-o}},{key:"rollbackbuffer",value:function(t){this.buffList.push({buff:t,offset:0})}},{key:"push",value:function(t){0===this.buffList.length&&this.buffList.push({buff:new Float32Array(this.frameLength),offset:0});var e=this.buffList[0];if(e.buff.length-e.offset>=t[0].length*$){var r=this.copy(t,0,e.buff,e.offset);e.offset+=r,e.buff.length===e.offset&&(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff))}else{var o=this.copy(t,0,e.buff,e.offset);if(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff),t[0].length*$>o){for(var i=[],n=0;n<$;n++)i.push(t[n].subarray(Math.floor(o/$)+(o%$>n?1:0)));this.push(i)}}}}]),t}(),U=function(){function t(e,r){var o=this;p()(this,t),this.context=r,this.decodePort=null,this.encodePort=null,this.captureSize=e/100*$,this.playBuffer=new B,this.playBuffer.onrollbackbuffer=function(t){o.decodePort},this.playBuffer.onneedmoredata=function(){o.decodePort&&o.decodePort.postMessage({status:1})},this.playBuffer.onCacheSizeChange=function(t){o.decodePort&&o.decodePort.postMessage({status:3,cacheSize:t})},this.quantum=new Float32Array(128*tt),this.captureBuffer=new N(this.captureSize),this.captureBuffer.onframedata=function(t){o.encodePort&&o.encodePort.postMessage({command:2,buffer:t},[t.buffer])}}return _()(t,[{key:"setDecodePort",value:function(t){this.decodePort&&this.decodePort.close(),this.decodePort=t,this.decodePort.onmessage=this.handleDecodeData.bind(this)}},{key:"setEncodePort",value:function(t){this.encodePort&&this.encodePort.close(),this.encodePort=t,this.encodePort.onmessage=this.handleEncodeData.bind(this)}},{key:"handleDecodeData",value:function(t){this.context.isPlaying&&this.playBuffer.push(t.data.data)}},{key:"handleEncodeData",value:function(t){switch(t.data.event){case 0:this.captureBuffer.rollbackbuffer(t.data.buffer)}}},{key:"requestMoreData",value:function(){this.playBuffer.requestMoreData()}},{key:"close",value:function(){this.decodePort&&(this.decodePort=null,this.decodePort.close()),this.encodePort&&(this.encodePort=null,this.encodePort.close())}},{key:"write",value:function(t){this.captureBuffer.push(t)}},{key:"read",value:function(){return this.playBuffer.copyTo(this.quantum),this.requestMoreData(),this.quantum}}]),t}(),W=function(){function t(e,r,o){if(p()(this,t),this.STATE_READ_READY=0,this.STATE_READ_INDEX=1,this.STATE_WRITE_READY=2,this.STATE_WRITE_INDEX=3,this.STATE_DATA_COUNT=4,this.STATE_CACHE_SIZE=5,this.STATY_READY_NO=0,this.STATY_READY_YES=1,this.sabState=new Uint32Array(e),this.sabBuffer=new Float32Array(r),this.perFrameLength=o,this.bufferLen=this.sabBuffer.length,this.supportSpecialOptimization=this.bufferLen%o==0,this.bufferIndex=null,this.supportSpecialOptimization){var i=this.bufferLen/o;this.bufferIndex=[];for(var n=0;n<i;n++)this.bufferIndex.push(this.sabBuffer.subarray(n*o,n*o+o))}this.placeBuffer=new Float32Array(this.perFrameLength),this.QUANTUM_SIZE=128,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MIN_VALUE=6,this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE),this.setCacheSize(this.CACHE_SIZE_MIN_VALUE),this._counter=0,this.onCacheSizeChange=null,this.cacheSizeController=new O}return _()(t,[{key:"getCacheSize",value:function(){return Atomics.load(this.sabState,this.STATE_CACHE_SIZE)}},{key:"setCacheSize",value:function(t){t>this.CACHE_SIZE_MAX_VALUE&&(t=this.CACHE_SIZE_MAX_VALUE),t<this.CACHE_SIZE_MIN_VALUE&&(t=this.CACHE_SIZE_MIN_VALUE),this.onCacheSizeChange&&this.cacheSizeController.shouldSendCacheSize(t)&&this.onCacheSizeChange(t),Atomics.store(this.sabState,this.STATE_CACHE_SIZE,t)}},{key:"setQuantumSize",value:function(t){this.QUANTUM_SIZE=t,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE)}},{key:"isNeedMoreData",value:function(){var t=Atomics.load(this.sabState,this.STATE_CACHE_SIZE);return Atomics.load(this.sabState,this.STATE_DATA_COUNT)<t*this.QUANTUM_SIZE}},{key:"shouldAdjustCacheBuffer",value:function(){this._counter>0&&this.setCacheSize(this.getCacheSize()+1)}},{key:"clear",value:function(){this.sabState&&(this.sabState[this.STATE_READ_READY]=0,this.sabState[this.STATE_READ_INDEX]=0,this.sabState[this.STATE_WRITE_READY]=0,this.sabState[this.STATE_WRITE_INDEX]=0,this.sabState[this.STATE_DATA_COUNT]=0),this._counter=0}},{key:"setWriteReady",value:function(){this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES}},{key:"isReady",value:function(){return this.sabState[this.STATE_WRITE_READY]&&this.sabState[this.STATE_READ_READY]}},{key:"getDataCount",value:function(){return Atomics.load(this.sabState,this.STATE_DATA_COUNT)}},{key:"write",value:function(t){if(t[0].length*$===this.perFrameLength){var e=this.sabState[this.STATE_READ_READY];if(this.sabState[this.STATE_WRITE_READY]||(this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES,this.sabState[this.STATE_WRITE_INDEX]=0),e)return this.supportSpecialOptimization?this.writeSpecial(t):this.writeNormal(t)}}},{key:"writeNormal",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<$;r++)for(var o=0;t[r]&&o<t[r].length;o++)this.sabBuffer[(e+o*$+r)%this.bufferLen]=t[r][o];(e+=this.perFrameLength)>=this.bufferLen&&(e-=this.bufferLen),this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"writeSpecial",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<$;r++)for(var o=0;t[r]&&o<t[r].length;o++)this.bufferIndex[e][o*$+r]=t[r][o];e=(e+1)%this.bufferIndex.length,this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"read",value:function(){var t=this.sabState[this.STATE_READ_READY],e=this.sabState[this.STATE_WRITE_READY];if(t||(this.sabState[this.STATE_READ_READY]=this.STATY_READY_YES,this.sabState[this.STATE_READ_INDEX]=0),!e)return null;var r=this.supportSpecialOptimization?this.readSpecial():this.readNormal();return null===r?this.shouldAdjustCacheBuffer():this._counter++,r}},{key:"readNormal",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r*this.perFrameLength+t)%this.bufferLen,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var o=null;if(this.bufferLen-t>=this.perFrameLength)o=this.sabBuffer.subarray(t,t+this.perFrameLength);else{var i=this.sabBuffer.subarray(t),n=this.sabBuffer.subarray(0,this.perFrameLength-i.length);(o=this.placeBuffer).set(i),o.set(n,i.length)}return(t+=this.perFrameLength)>=this.bufferLen&&(t-=this.bufferLen),this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),o}},{key:"readSpecial",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r+t)%this.bufferIndex.length,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var o=this.bufferIndex[t];return t=(t+1)%this.bufferIndex.length,this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),o}}]),t}(),z="undefined"!=typeof SharedArrayBuffer,F=!0,H=null,Y=null,j=null,Z=null,G=null,V=0,X=0,Q=!1,q=0,K=0,J=!1,$=1,tt=1,et=null,rt=10,ot=1500,it=new Map;function nt(t){if(t){var e=t.length/16,r=0,o=0;for(r=0;r<e;r++){var i=0;for(o=16*r+0;o<16*r+4;o++)i+=t[o]*Math.pow(256,o-16*r);i>>=10;var n=0;for(o=16*r+4;o<16*r+12;o++)n+=t[o]*Math.pow(256,o-16*r-4);it.set(i,n)}}}function st(t){t>>=10;var e=it.get(t);return e?(it.set(t,0),e):0}function at(t){var e=t[1];return 4294967296*t[2]+e}globalThis.update_play_time=function(t,e){if(e){var r=new Uint8Array(e),o=Module.HEAP8.subarray(t+0,t+e);if(r.set(o),J){var i;null===(i=ct.videoDecodePort)||void 0===i||i.postMessage({status:1,data:r},[r.buffer])}else{for(var n=new Uint32Array(r.buffer),s=0,a=0,u=0;u<r.length/16;u++){var h=n[4*u];512&h?a=at(n.subarray(4*u,4*u+4)):h>>10==K>>10&&(s=at(n.subarray(4*u,4*u+4)))}if(!s&&!a)return;ct.port.postMessage({status:57,at:s,st:a})}}};var ut=null,ht=null;globalThis.frame_callback=function(t,e,r,o,i,n,s,a){ut===t&&ht.length==e*s||(ht=Module.HEAPF32.subarray(t/4,t/4+e*s),ut=t),et.push(ht)};var ct=null;var ft=function(t){s()(r,t);var e=L(r);function r(t){var o,n,s;return p()(this,r),s=e.call(this),ct=i()(s),monitorLOG("WIB"),s.port.onmessage=s.handleMessage.bind(i()(s)),s.isPlaying=!1,s.isCapturing=!1,s.wasmModule=null==t||null===(o=t.processorOptions)||void 0===o?void 0:o.wasmModule,t&&t.processorOptions&&(t.processorOptions.audioEncodeChannelsNum&&($=t.processorOptions.audioEncodeChannelsNum),t.processorOptions.audioDecodeChannelsNum&&(tt=t.processorOptions.audioDecodeChannelsNum)),s.SABConstructor(t&&t.processorOptions?t.processorOptions.sharedBuffer:null),s.noSABConstructor(),globalThis.fsHandler&&globalThis.fsHandler.setPort(s.port),null!=t&&null!==(n=t.processorOptions)&&void 0!==n&&n.userAgent&&_workletPrinter.setUserAgent(t.processorOptions.userAgent),monitorLOG("WIE"),s}return _()(r,[{key:"SABConstructor",value:function(t){this.sampleRate_=0,this.g_sharedbuffer=t||null,this.encodeSAB=null,this.decodeSAB=null,this.audioEncodePort=null,this.audioDecodePort=null,this.videoDecodePort=null,this.rtpSAB=null,this.stopPlayAudio=!1,et=new v(128*tt,sampleRate/100*tt)}},{key:"noSABConstructor",value:function(){this.audioProcessBuffer=new U(sampleRate,this),this.isRunning=!0}},{key:"handleMessage",value:function(t){var e=t.data,r=e.status,o=e.data;switch(r){case"diableSharedArrayBuffer":z=!1;break;case"disableDecoderinworklet":F=!1;break;case"data":console.info("Dropped audio data before initialized");break;case"stopPlayAudio":this.isPlaying=!1;break;case"stopWorklet":dt=!0;break;case"startPlayAudio":this.isPlaying=!0;break;case"StartCaptureAudio":this.isCapturing=!0;break;case"sampleRate":this.sampleRate_=o;break;case"audiowasm":try{initWasm(Module,this.wasmModule)}catch(t){_workletPrinter.error("init WASM failed, error message:"+t.message+t.stack)}break;case"initData":q=o.userid,V=o.meetingid,X=o.meetingnum,Q=o.qoson;break;case"currentSSRC":K=o;break;case"stop_audio_incoming":this.stopPlayAudio=o;break;case"codecDoAVSync":J=!0,G&&j&&G(j,!0);break;case"checkProcess":monitorLOG("PCC"+pt),pt=0;break;case"interpretation_set_lang":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.lang,D(j,1,C,1);break;case"interpretation_enable":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.enable?1:0,D(j,0,C,1);break;case"interpretation_mute_origin":Module.HEAPU32.subarray(C/4,C/4+rt)[0]=o.mute?1:0,D(j,2,C,1);break;case"interpretation_set_interpreter":var i=Module.HEAPU32.subarray(C/4,C/4+rt),n=C;o.interpreterList.length>=rt&&(n=Module._malloc(4*o.interpreterList.length),i=Module.HEAPU32.subarray(n/4,n/4+o.interpreterList.length));for(var s=0;s<o.interpreterList.length;s++)i[s]=o.interpreterList[s];D(j,3,n,o.interpreterList.length),o.interpreterList.length>=rt&&Module._free(n);break;case"setSpeechVolumeLevel":if(!j)return;R(j,o.userid,o.volume);break;default:z?this.handleMessageForSAB(t):this.handleMessageForNoSAB(t)}}},{key:"handleMessageForSAB",value:function(t){var e=this,r=t.data,o=r.status,i=r.data;switch(o){case"encodeAudioPort":this.audioEncodePort&&this.audioEncodePort.close(),this.audioEncodePort=t.ports[0];break;case"decodeAudioPort":this.audioDecodePort&&this.audioDecodePort.close(),this.audioDecodePort=t.ports[0],_workletPrinter.setAudioDecodeWorkerPort(t.ports[0]),this.audioDecodePort.onmessage=function(t){};break;case"decodeVideoPort":this.videoDecodePort&&this.videoDecodePort.close(),this.videoDecodePort=t.ports[0];break;case"close":break;case"sharedBuffer":i&&(this.g_sharedbuffer=i),this.g_sharedbuffer&&(this.encodeSAB=new W(this.g_sharedbuffer.inputState,this.g_sharedbuffer.inputBuffer,128*$),this.decodeSAB=new W(this.g_sharedbuffer.outputState,this.g_sharedbuffer.outputBuffer,128*tt),this.rtpSAB=new m(this.g_sharedbuffer.rtpBuffer,1200),this.decodeSAB.onCacheSizeChange=function(t){e.audioDecodePort&&e.audioDecodePort.postMessage({status:3,cacheSize:t,isSAB:!0})});break;default:console.warn("unhanle commands in audioworklet",o)}}},{key:"handleMessageForNoSAB",value:function(t){var e=t.data.status;switch(e){case"encodeAudioPort":this.audioProcessBuffer.setEncodePort(t.ports[0]);break;case"decodeAudioPort":_workletPrinter.setAudioDecodeWorkerPort(t.ports[0]),this.audioProcessBuffer.setDecodePort(t.ports[0]);break;case"close":this.audioProcessBuffer.close(),this.isPlaying=!1,this.isRunning=!1;break;default:console.warn("unhanle commands in audioworklet",e)}}},{key:"onReceivedRTP",value:function(){}},{key:"process",value:function(t,e,r){if(pt++,dt)return!1;try{return z?F?this.SABDecodeProcess(t,e,r):this.SABProcess(t,e,r):this.NoSABprocess(t,e,r)}catch(t){return _workletPrinter.error("::process() exception: "+t.message+t.stack),!0}}},{key:"NoSABprocess",value:function(t,e,r){return!!this.isRunning&&(!this.isPlaying||(this.inputDataForNoSAB(t),this.outputDataForNoSAB(e),!0))}},{key:"inputDataForNoSAB",value:function(t){if(!t[0]||!t[0][0])return!0;this.audioProcessBuffer.write(t[0])}},{key:"outputDataForNoSAB",value:function(t){var e=this.audioProcessBuffer.read();if(this.stopPlayAudio)return!0;var r=t[0];if(1===tt)for(var o=0;o<r.length;o++)r[o].set(e);else for(var i=0;i<tt;i++)for(var n=0;r[i]&&n<r[i].length;n++)r[i][n]=e[n*tt+i]}},{key:"inputData",value:function(t){if(!this.encodeSAB)return!0;this.encodeSAB.write(t),this.audioEncodePort.postMessage({command:2,buffer:!1})}},{key:"outputDecodeData",value:function(t){try{et.hasData()||Z&&(sampleRate!=lt&&(globalThis.sampleRateLog(lt,sampleRate,"","",3),lt=sampleRate),Z(j,sampleRate/100,0,sampleRate,tt))}catch(t){_workletPrinter.error("::outputDecodeData() get_mixed_Audio exception: "+t.message+t.stack)}try{var e=et.read();if(!e)return;if(1===tt)for(var r=0;r<t.length;r++)t[r].set(e);else for(var o=0;o<tt;o++)for(var i=0;t[o]&&i<t[o].length;i++)t[o][i]=e[i*tt+o]}catch(t){_workletPrinter.error("::outputDecodeData() set outputs exception: "+t.message+t.stack)}}},{key:"outputData",value:function(t){if(!this.decodeSAB)return!0;var e=this.decodeSAB.read();if(null===e||this.stopPlayAudio)return!0;if(1===tt)for(var r=0;r<t.length;r++)t[r].set(e);else for(var o=0;o<tt;o++)for(var i=0;t[o]&&i<t[o].length;i++)t[o][i]=e[i*tt+o]}},{key:"SABDecodeProcess",value:function(t,e,r){try{if(!this.rtpSAB)return globalThis.monitorLOG("SABN"),!0;var o=this.rtpSAB.available_read();o>100&&(o=100);for(var i=this.rtpSAB.getReaderPtr(),n=0;n<o;){n++;var s=this.rtpSAB.get(i);i++,j&&(Module.HEAP8.subarray(I,I+ot).set(s),Y(j,0,I,s.length))}this.rtpSAB.setReaderPtr(i)}catch(t){_workletPrinter.error("::SABDecodeProcess() audio_decode exception: "+t.message+t.stack)}try{var a=t[0],u=e[0];return!this.g_sharedbuffer||(!this.sampleRate_||!u[0]||(a[0]&&this.isCapturing&&this.inputData(a),this.outputDecodeData(u),!0))}catch(t){_workletPrinter.error("::SABDecodeProcess() inputs or outputs exception: "+t.message+t.stack)}return!0}},{key:"SABProcess",value:function(t,e,r){var o=t[0],i=e[0];return!this.g_sharedbuffer||(!this.sampleRate_||!i[0]||(o[0]&&this.isCapturing&&this.inputData(o),this.outputData(i),!0))}}],[{key:"parameterDescriptors",get:function(){return[{name:"pcm",defaultValue:1}]}}]),r}(l()(AudioWorkletProcessor)),lt=0,dt=!1,pt=0;globalThis.LOG_OUT=function(){},globalThis.fsHandler?(globalThis.LOG_OUT_WEBRTC=globalThis.fsHandler.handleFile,globalThis.Get_ExternalRecord=globalThis.fsHandler.handleViperPrint):(globalThis.LOG_OUT_WEBRTC=function(){},globalThis.Get_ExternalRecord=function(){}),globalThis.send_data=function(){},globalThis.monitorLOG=function(t){t&&ct.port.postMessage({status:"MONITOR_LOG",data:t})},globalThis.sampleRateLog=function(t,e,r,o,i){if(t||e){var n=null;switch(i){case 1:n="GGDS: ";break;case 2:n="SCAG: ";break;case 3:n="SCIW: "}var s=n+t+"|"+e+"|"+r+"|"+o;globalThis.monitorLOG(s)}},globalThis.wcl_trace_log=function(t,e){globalThis.fsHandler&&globalThis.fsHandler.handleAudioSDKUtilPrint(t,e)},registerProcessor("zoomAudioWorklet",ft)}]); | ||
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_audio_worklet.min.js-20c4b5d5d4c2157efb4c.map |
!function(t){var e={};function r(s){if(e[s])return e[s].exports;var i=e[s]={i:s,l:!1,exports:{}};return t[s].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,s){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(s,i,function(e){return t[e]}.bind(null,i));return s},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=18)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(14);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}t.exports=function(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e,s){return t.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,s)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(5).default,i=r(6);t.exports=function(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(4),i=r(7),n=r(11),o=r(12);function a(e){var r="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!n(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return o(t,arguments,s(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,a(e)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(7),i=r(13);function n(e,r,o){return i()?(t.exports=n=Reflect.construct.bind(),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=n=function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&s(n,r.prototype),n},t.exports.__esModule=!0,t.exports.default=t.exports),n.apply(null,arguments)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(5).default,i=r(15);t.exports=function(t){var e=i(t,"string");return"symbol"===s(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var s=r(5).default;t.exports=function(t,e){if("object"!==s(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e,r){"use strict";r.r(e);var s=r(6),i=r.n(s),n=r(8),o=r.n(n),a=r(9),u=r.n(a),h=r(4),f=r.n(h),c=r(10),l=r.n(c),p=r(0),_=r.n(p),A=r(1),E=r.n(A);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,s=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(s,arguments,i)}else r=s.apply(this,arguments);return u()(this,r)}}var d=!1,b=function(){function t(){_()(this,t),this.cacheSize=0,this.sameCacheSizeCounter=0}return E()(t,[{key:"shouldSendCacheSize",value:function(t){return t===this.cacheSize&&this.sameCacheSizeCounter++,(this.cacheSize!==t||200===this.sameCacheSizeCounter)&&(this.sameCacheSizeCounter=0,this.cacheSize=t,!0)}}]),t}(),T=1,y=function(){function t(e,r,s){if(_()(this,t),this.STATE_READ_READY=0,this.STATE_READ_INDEX=1,this.STATE_WRITE_READY=2,this.STATE_WRITE_INDEX=3,this.STATE_DATA_COUNT=4,this.STATE_CACHE_SIZE=5,this.STATY_READY_NO=0,this.STATY_READY_YES=1,this.sabState=new Uint32Array(e),this.sabBuffer=new Float32Array(r),this.perFrameLength=s,this.bufferLen=this.sabBuffer.length,this.supportSpecialOptimization=this.bufferLen%s==0,this.bufferIndex=null,this.supportSpecialOptimization){var i=this.bufferLen/s;this.bufferIndex=[];for(var n=0;n<i;n++)this.bufferIndex.push(this.sabBuffer.subarray(n*s,n*s+s))}this.placeBuffer=new Float32Array(this.perFrameLength),this.QUANTUM_SIZE=128,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MIN_VALUE=6,this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE),this.setCacheSize(this.CACHE_SIZE_MIN_VALUE),this._counter=0,this.onCacheSizeChange=null,this.cacheSizeController=new b}return E()(t,[{key:"getCacheSize",value:function(){return Atomics.load(this.sabState,this.STATE_CACHE_SIZE)}},{key:"setCacheSize",value:function(t){t>this.CACHE_SIZE_MAX_VALUE&&(t=this.CACHE_SIZE_MAX_VALUE),t<this.CACHE_SIZE_MIN_VALUE&&(t=this.CACHE_SIZE_MIN_VALUE),this.onCacheSizeChange&&this.cacheSizeController.shouldSendCacheSize(t)&&this.onCacheSizeChange(t),Atomics.store(this.sabState,this.STATE_CACHE_SIZE,t)}},{key:"setQuantumSize",value:function(t){this.QUANTUM_SIZE=t,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE)}},{key:"isNeedMoreData",value:function(){var t=Atomics.load(this.sabState,this.STATE_CACHE_SIZE);return Atomics.load(this.sabState,this.STATE_DATA_COUNT)<t*this.QUANTUM_SIZE}},{key:"shouldAdjustCacheBuffer",value:function(){this._counter>0&&this.setCacheSize(this.getCacheSize()+1)}},{key:"clear",value:function(){this.sabState&&(this.sabState[this.STATE_READ_READY]=0,this.sabState[this.STATE_READ_INDEX]=0,this.sabState[this.STATE_WRITE_READY]=0,this.sabState[this.STATE_WRITE_INDEX]=0,this.sabState[this.STATE_DATA_COUNT]=0),this._counter=0}},{key:"setWriteReady",value:function(){this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES}},{key:"isReady",value:function(){return this.sabState[this.STATE_WRITE_READY]&&this.sabState[this.STATE_READ_READY]}},{key:"getDataCount",value:function(){return Atomics.load(this.sabState,this.STATE_DATA_COUNT)}},{key:"write",value:function(t){if(t[0].length*T===this.perFrameLength){var e=this.sabState[this.STATE_READ_READY];if(this.sabState[this.STATE_WRITE_READY]||(this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES,this.sabState[this.STATE_WRITE_INDEX]=0),e)return this.supportSpecialOptimization?this.writeSpecial(t):this.writeNormal(t)}}},{key:"writeNormal",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<T;r++)for(var s=0;t[r]&&s<t[r].length;s++)this.sabBuffer[(e+s*T+r)%this.bufferLen]=t[r][s];(e+=this.perFrameLength)>=this.bufferLen&&(e-=this.bufferLen),this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"writeSpecial",value:function(t){for(var e=this.sabState[this.STATE_WRITE_INDEX],r=0;r<T;r++)for(var s=0;t[r]&&s<t[r].length;s++)this.bufferIndex[e][s*T+r]=t[r][s];e=(e+1)%this.bufferIndex.length,this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}},{key:"read",value:function(){var t=this.sabState[this.STATE_READ_READY],e=this.sabState[this.STATE_WRITE_READY];if(t||(this.sabState[this.STATE_READ_READY]=this.STATY_READY_YES,this.sabState[this.STATE_READ_INDEX]=0),!e)return null;var r=this.supportSpecialOptimization?this.readSpecial():this.readNormal();return null===r?this.shouldAdjustCacheBuffer():this._counter++,r}},{key:"readNormal",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r*this.perFrameLength+t)%this.bufferLen,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var s=null;if(this.bufferLen-t>=this.perFrameLength)s=this.sabBuffer.subarray(t,t+this.perFrameLength);else{var i=this.sabBuffer.subarray(t),n=this.sabBuffer.subarray(0,this.perFrameLength-i.length);(s=this.placeBuffer).set(i),s.set(n,i.length)}return(t+=this.perFrameLength)>=this.bufferLen&&(t-=this.bufferLen),this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),s}},{key:"readSpecial",value:function(){var t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){var r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r+t)%this.bufferIndex.length,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}var s=this.bufferIndex[t];return t=(t+1)%this.bufferIndex.length,this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),s}}]),t}(),x="undefined"!=typeof SharedArrayBuffer,m=function(t){o()(r,t);var e=S(r);function r(t){var s;return _()(this,r),(s=e.call(this)).port.onmessage=s.handleMessage.bind(i()(s)),s.isPlaying=!1,s.isCapturing=!1,s.audioEncodePort=null,t&&t.processorOptions&&t.processorOptions.sharingEncodeChannelsNum&&(T=t.processorOptions.sharingEncodeChannelsNum),s}return E()(r,[{key:"handleMessage",value:function(t){var e=t.data,r=e.status,s=e.data;switch(r){case"StartCaptureAudio":this.isCapturing=!0;break;case"sampleRate":this.sampleRate_=s;break;case"encodeAudioPort":this.audioEncodePort&&this.audioEncodePort.close(),this.audioEncodePort=t.ports[0];break;case"stopWorklet":d=!0;break;default:x?this.handleMessageForSAB(t):console.warn("unhanle commands in audioworklet",r)}}},{key:"handleMessageForSAB",value:function(t){var e=t.data,r=e.status,s=e.data;switch(r){case"sharedBuffer":s&&(this.g_sharedbuffer=s),this.g_sharedbuffer&&(this.sharingSAB=new y(this.g_sharedbuffer.sharingInputState,this.g_sharedbuffer.sharingInputBuffer,128*T));break;default:console.warn("unhanle commands in audioworklet",r)}}},{key:"process",value:function(t,e,r){return!d&&(!!x&&this.SABProcess(t,r))}},{key:"inputData",value:function(t){if(!this.sharingSAB)return!0;this.sharingSAB.write(t[0]),this.audioEncodePort.postMessage({command:2,buffer:!1})}},{key:"SABProcess",value:function(t,e){var r=t[0];return!this.g_sharedbuffer||(r[0]&&this.isCapturing&&this.inputData(t),!0)}}],[{key:"parameterDescriptors",get:function(){return[{name:"pcm",defaultValue:1}]}}]),r}(l()(AudioWorkletProcessor));registerProcessor("zoomSharingAudioWorklet",m)}]); | ||
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_sharing_audio_worklet.min.js-5e5c1c465575befb41de.map | ||
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_sharing_audio_worklet.min.js-20c4b5d5d4c2157efb4c.map |
@@ -582,1 +582,12 @@ /** | ||
} | ||
/** | ||
* Customer Web component for video render | ||
*/ | ||
export declare class VideoPlayer extends HTMLElement { | ||
['node-id']: string; | ||
['video-quality']: string; | ||
} | ||
/** | ||
* Customer Web component for video render container | ||
*/ | ||
export declare class VideoPlayerContainer extends HTMLElement {} |
@@ -14,3 +14,3 @@ import { ZoomVideo } from './zoomvideo'; | ||
export * from './live-stream'; | ||
export * from './summary'; | ||
// export * from './summary'; | ||
export default ZoomVideo; |
@@ -78,3 +78,3 @@ import { ExecutedResult, LoggerInitOption, Participant } from './common'; | ||
} from './event-callback'; | ||
import AIClient from '../src/summary'; | ||
// import AIClient from '../src/summary'; | ||
@@ -190,2 +190,6 @@ /** | ||
patchJsMedia?: boolean; | ||
/** | ||
* Alternative name for Zoom Video Player to avoid name conflict with existing web component. | ||
*/ | ||
alternativeNameForVideoPlayer?: string; | ||
} | ||
@@ -910,3 +914,3 @@ /** | ||
*/ | ||
function getAIClient(): typeof AIClient; | ||
// function getAIClient(): typeof AIClient; | ||
/** | ||
@@ -913,0 +917,0 @@ * Gets the liveStream client. |
{ | ||
"name": "@zoom/videosdk", | ||
"version": "1.10.5", | ||
"version": "1.10.7", | ||
"description": "Zoom Web Video SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -44,3 +44,3 @@ # Zoom Video SDK for Web | ||
| userName | Required, a name for the participant. | | ||
| password | Required, a session passcode of your choice or the passcode of the session you are joining. | | ||
| password | Optional, a session passcode of your choice or the passcode of the session you are joining. | | ||
@@ -84,1 +84,3 @@ Then start or join the session and define the stream, which will be used for [core features](#core-features). | ||
If you're looking for help, try [Developer Support](https://devsupport.zoom.us) or our [Developer Forum](https://devforum.zoom.us). Priority support is also available with [Premier Developer Support](https://zoom.us/docs/en-us/developer-support-plans.html) plans. | ||
[Open Source Software attribution](https://github.com/zoom/videosdk-web/blob/main/oss_attribution.txt) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
31033238
37477
85