Files
BW/videocall3/Translator.js/Robot-Speaker.js

11 lines
2.2 MiB
JavaScript
Raw Permalink Normal View History

2026-11-19 18:32:17 -05:00
// eSpeak and other code here are under the GNU GPL.
function generateSpeech(text, args) {
var self = { text: text, args: args, ret: null };
(function() {
function da(b){throw b}var qa=void 0,Fa=null,La={noInitialRun:!0},Ya=[],jb=typeof process==="object",sb=typeof window==="object",Cb=typeof importScripts==="function",Db=!sb&&!jb&&!Cb;if(jb){print=(function(b){process.stdout.write(b+"\n")});printErr=(function(b){process.stderr.write(b+"\n")});var Lb=require("fs");read=(function(b){var d=Lb.readFileSync(b).toString();!d&&b[0]!="/"&&(b=__dirname.split("/").slice(0,-1).join("/")+"/src/"+b,d=Lb.readFileSync(b).toString());return d});Ya=process.argv.slice(2)}else{Db?(this.read||(read=(function(b){snarf(b)})),Ya=this.arguments?arguments:scriptArgs):sb?(print=printErr=(function(b){console.log(b)}),read=(function(b){var d=new XMLHttpRequest;d.open("GET",b,!1);d.send(Fa);return d.responseText}),this.arguments&&(Ya=arguments)):Cb?load=importScripts:da("Unknown runtime environment. Where are we?")}function Qb(b){eval.call(Fa,b)}typeof load=="undefined"&&typeof read!="undefined"&&(load=(function(b){Qb(read(b))}));typeof printErr==="undefined"&&(printErr=(function(){}));typeof print==="undefined"&&(print=printErr);try{this.Module=La}catch(Ub){this.Module=La={}}if(!La.arguments){La.arguments=Ya}if(La.print){print=La.print}function Vb(b){if(Wb==1){return 1}var d={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+b];d||(b[b.length-1]=="*"?d=Wb:b[0]=="i"&&(b=parseInt(b.substr(1)),bc(b%8==0),d=b/8));return d}function cc(b){var d=a;a+=b;a=a+3>>2<<2;return d}function kc(b){var d=lc;lc+=b;lc=lc+3>>2<<2;if(lc>=nc){for(;nc<=lc;){nc=Math.ceil(2*nc/pc)*pc}var b=h,c=new ArrayBuffer(nc);h=new Int8Array(c);j=new Int16Array(c);n=new Int32Array(c);o=new Uint8Array(c);rc=new Uint16Array(c);q=new Uint32Array(c);sc=new Float32Array(c);h.set(b)}return d}var Wb=4,uc={},Ac=0,t,Fc;function Pc(b){print(b+":\n"+Error().stack);da("Assertion: "+b)}function bc(b,d){b||Pc("Assertion failed: "+d)}var Rc=this;La.ccall=(function(b,d,c,e){try{var f=eval("_"+b)}catch(i){try{f=Rc.Module["_"+b]}catch(k){}}bc(f,"Cannot call unknown function "+b+" (perhaps LLVM optimizations or closure removed it?)");var l=0,b=e?e.map((function(b){if(c[l++]=="string"){var d=a;cc(b.length+1);Tc(b,d);b=d}return b})):[];return(function(b,c){return c=="string"?Yc(b):b})(f.apply(Fa,b),d)});function Zc(b,d,c){c=c||"i8";c[c.length-1]==="*"&&(c="i32");switch(c){case"i1":h[b]=d;break;case"i8":h[b]=d;break;case"i16":j[b>>1]=d;break;case"i32":n[b>>2]=d;break;case"i64":n[b>>2]=d;break;case"float":sc[b>>2]=d;break;case"double":v[0]=d;n[b>>2]=z[0];n[b+4>>2]=z[1];break;default:Pc("invalid type for setValue: "+c)}}La.setValue=Zc;La.getValue=(function(b,d){d=d||"i8";d[d.length-1]==="*"&&(d="i32");switch(d){case"i1":return h[b];case"i8":return h[b];case"i16":return j[b>>1];case"i32":return n[b>>2];case"i64":return n[b>>2];case"float":return sc[b>>2];case"double":return z[0]=n[b>>2],z[1]=n[b+4>>2],v[0];default:Pc("invalid type for setValue: "+d)}return Fa});var $c=0,cd=1,F=2;La.ALLOC_NORMAL=$c;La.ALLOC_STACK=cd;La.ALLOC_STATIC=F;function H(b,d,c){var e,f;typeof b==="number"?(e=!0,f=b):(e=!1,f=b.length);var i=typeof d==="string"?d:Fa,c=[dd,cc,kc][c===qa?F:c](Math.max(f,i?1:d.length));if(e){return gd(c,0,f),c}e=0;for(var k;e<f;){var l=b[e];typeof l==="function"&&(l=uc.Rl(l));k=i||d[e];k===0?e++:(k=="i64"&&(k="i32"),Zc(c+e,l,k),e+=Vb(k))}return c}La.allocate=H;function Yc(b,d){for(var c=typeof d=="undefined",e="",f=0,i,k=String.fromCharCode(0);;){i=String.fromCharCode(o[b+f]);if(c&&i==k){break}e+=i;f+=1;if(!c&&f==d){break}}return e}La.Pointer_stringify=Yc;La.Array_stringify=(function(b){for(var d="",c=0;c<b.length;c++){d+=String.fromCharCode(b[c])}return d});var id,pc=4096,h,o,j,rc,n,q,sc,a,jd,lc,kd=La.TOTAL_STACK||5242880,nc=La.TOTAL_MEMORY||10485760;bc(!!Int32Array&&!!Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,"Cannot fallback to non-typed array case: Code is too specialized");var nd=new ArrayBuffer(nc);h=new Int8Array(nd);j=new Int16Array(nd);n=new Int32Array(nd);o=new Uint8Array(nd);rc=new Uint16Array(nd);q=new Uint32Array(nd);sc=new Float32Array(nd);n[0]=255;bc(o[0]===255&&o[3]===0,"Typed arrays 2 must be
}).call(self);
return self.ret;
}