PageSourceSearch

https://textkits.org/_next/static/chunks/5305.913543e0257f2f41.js

js textkits.org collected 2026-09-24 10:22:42 UTC 15,977 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5305],{35299:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(19904).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},35305:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var a=r(95155),l=r(12115),n=r(35299),s=r(26667),o=r(9295),i=r(52056),d=r(39867),c=r(73161),m=r(27329),u=r(49498),x=r(70517),b=r(89167);let h=b.cF[0].text,p=[{key:"neutral",label:"Default voice",helper:"Original browser TTS profile"},{key:"male",label:"Male tone",helper:"Lower pitch for a deeper read"},{key:"girl",label:"Girl tone",helper:"Brighter pitch for a lighter read"}],f=null;function g(e){return(null==e?void 0:e.byteLength)?ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e):null}async function v(e,t){var r;let a=new(await ((null==(r=window.lamejs)?void 0:r.Mp3Encoder)?Promise.resolve(window.lamejs):f||(f=new Promise((e,t)=>{let r=document.createElement("script");r.src="/vendor/lame.min.js",r.async=!0,r.onload=()=>{var r;(null==(r=window.lamejs)?void 0:r.Mp3Encoder)?e(window.lamejs):t(Error("MP3 encoder loaded but did not initialize."))},r.onerror=()=>t(Error("Could not load the MP3 encoder.")),document.head.appendChild(r)})))).Mp3Encoder(1,t,64),l=function(e){let t=e instanceof Float32Array?e:new Float32Array(e||[]),r=new Int16Array(t.length);for(let e=0;e<t.length;e+=1){let a=Math.max(-1,Math.min(1,t[e]));r[e]=a<0?32768*a:32767*a}return r}(e),n=[];for(let e=0;e<l.length;e+=1152){let t=g(a.encodeBuffer(l.subarray(e,e+1152)));(null==t?void 0:t.byteLength)&&n.push(t)}let s=g(a.flush());return(null==s?void 0:s.byteLength)&&n.push(s),new Blob(n,{type:"audio/mpeg"})}function w(e){if(!e)return"0 B";let t=["B","KB","MB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),a=e/1024**r;return"".concat(a.toFixed(a>=10||0===r?0:1)," ").concat(t[r])}function j(e){let{progress:t}=e;return(null==t?void 0:t.file)||(null==t?void 0:t.progress)!=null?(0,a.jsxs)("div",{className:"rounded-full border-2 border-emerald-100 bg-emerald-50 px-3 py-1 text-xs font-black uppercase tracking-[0.12em] text-emerald-800",children:[t.file?t.file:"model"," ",null==t.progress?"":"".concat(Math.round(t.progress),"%")]}):null}function k(){var e;let t=(0,l.useRef)(null),r=(0,l.useRef)(0),f=(0,l.useRef)(null),g=(0,l.useRef)(""),k=(0,l.useRef)(""),[y,N]=(0,l.useState)(h),[A,M]=(0,l.useState)("Ready for short English text."),[U,R]=(0,l.useState)(""),[L,S]=(0,l.useState)(!1),[P,_]=(0,l.useState)(null),[C,E]=(0,l.useState)(""),[V,z]=(0,l.useState)(""),[F,T]=(0,l.useState)(""),[B,G]=(0,l.useState)(""),[O,W]=(0,l.useState)(0),[D,$]=(0,l.useState)(0),[I,H]=(0,l.useState)(p[0].key),[K,q]=(0,l.useState)(""),[X,J]=(0,l.useState)(""),[Q,Y]=(0,l.useState)(!1),Z=(0,l.useMemo)(()=>(0,b.b1)(y),[y]),ee=(0,l.useMemo)(()=>(0,b.ou)(Z),[Z]),et=(0,l.useMemo)(()=>p.find(e=>e.key===I)||p[0],[I]);function er(e){Y(!0),(0,x.nj)({action:"download",path:"/text-to-voice-changer/",text:X||"".concat(e.toUpperCase()," voice preview")})}return(0,l.useEffect)(()=>()=>{var e;null==(e=t.current)||e.terminate(),g.current&&URL.revokeObjectURL(g.current),k.current&&URL.revokeObjectURL(k.current)},[]),(0,a.jsxs)("section",{"aria-labelledby":"text-to-voice-tool-heading",className:"mx-auto mt-8 w-full max-w-6xl rounded-[2.4rem] border-[6px] border-slate-950 bg-white p-4 shadow-[0_28px_90px_-56px_rgba(15,23,42,0.45)] sm:p-6 lg:p-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-black uppercase tracking-[0.16em] text-slate-500",children:"Browser TTS worker"}),(0,a.jsx)("h2",{id:"text-to-voice-tool-heading",className:"mt-2 text-3xl font-black tracking-tighter text-slate-950 sm:text-4xl",children:"Generate an MP3 or WAV voice preview"})]}),(0,a.jsx)("div",{className:"inline-flex w-fit rounded-full border-2 border-amber-200 bg-amber-50 px-4 py-2 text-sm font-black text-amber-800",children:"No cloning. No live mic effects."})]}),(0,a.jsxs)("div",{className:"mt-6 grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,0.95fr)]",children:[(0,a.jsxs)("div",{className:"min-w-0 rounded-[2rem] border-4 border-slate-100 bg-white p-4 sm:p-5",children:[(0,a.jsx)("label",{htmlFor:"text-to-voice-input",className:"text-sm font-black uppercase tracking-[0.16em] text-slate-500",children:"Text input"}),(0,a.jsx)("textarea",{id:"text-to-voice-input",value:y,onChange:e=>
1N(e.target.value),rows:7,className:"mt-3 min-h-[9rem] w-full resize-y rounded-[1.5rem] border-4 border-slate-200 bg-slate-50 p-4 text-lg font-bold leading-relaxed text-slate-950 outline-none transition focus:border-emerald-400 focus:bg-white",placeholder:"Type short English text..."}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2 text-sm font-bold text-slate-500",children:[(0,a.jsxs)("span",{children:[String(null!=(e=y)?e:"").trim().length," / ",b.C2," characters"]}),(0,a.jsxs)("span",{children:[ee.words," words / ",(0,b.vk)(ee.seconds)]})]}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:b.cF.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>{N(e.text),R(""),M("Example loaded. Generate voice when ready.")},className:(0,u.cn)("rounded-full border-2 px-4 py-2 text-sm font-black transition hover:-translate-y-0.5",t>1?"hidden sm:inline-flex":"inline-flex",0===t&&"border-emerald-200 bg-emerald-50 text-emerald-800",1===t&&"border-blue-200 bg-blue-50 text-blue-700",2===t&&"border-orange-200 bg-orange-50 text-orange-700"),children:e.label},e.key))}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-black uppercase tracking-[0.16em] text-slate-500",children:"Voice style"}),(0,a.jsx)("p",{className:"mt-1 text-sm font-bold text-slate-500",children:"Pick a simple tone before generating audio."})]}),(0,a.jsx)("span",{className:"rounded-full border-2 border-slate-200 bg-slate-50 px-3 py-1 text-xs font-black uppercase tracking-[0.12em] text-slate-500",children:et.label})]}),(0,a.jsx)("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:p.map(e=>{let t=I===e.key;return(0,a.jsxs)("button",{type:"button",onClick:()=>H(e.key),"aria-pressed":t,className:(0,u.cn)("min-h-[5.5rem] rounded-[1.25rem] border-4 p-3 text-left transition hover:-translate-y-0.5",t?"border-emerald-700 bg-emerald-50 text-emerald-900 shadow-[0_8px_0_#065f46]":"border-slate-200 bg-white text-slate-700 hover:border-emerald-200"),children:[(0,a.jsx)("span",{className:"block text-base font-black",children:e.label}),(0,a.jsx)("span",{className:"mt-1 block text-sm font-bold leading-snug text-slate-500",children:e.helper})]},e.key)})})]}),(0,a.jsxs)("div",{className:"mt-5 grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto]",children:[(0,a.jsxs)(c.$,{type:"button",onClick:function(){let e=(0,b.b1)(y);if(!e)return void R("Enter short text before generating voice.");let a=r.current+1;r.current=a,f.current={id:a,text:e,voicePresetLabel:et.label},N(e),R(""),S(!0),T(""),G(""),W(0),$(0),q(""),J(""),Y(!1),M("Starting browser voice generation with ".concat(et.label,".")),_(null),(function(){if(t.current)return t.current;let e=new Worker("/workers/text-to-voice-worker.js",{type:"module",name:"text-to-voice-changer"});return e.onmessage=async e=>{let t=e.data||{};if("status"===t.type){M(t.message||"Working in your browser."),t.device&&E(t.device);return}if("model-progress"===t.type)return void _(t);if(t.id===r.current){if("complete"===t.type){try{var a;let e=(null==(a=f.current)?void 0:a.id)===t.id?f.current:null,r=t.voicePresetLabel||(null==e?void 0:e.voicePresetLabel)||"Generated voice",l=(null==e?void 0:e.text)||"";M("Encoding MP3 and WAV downloads.");let n=t.sampleRate||16e3,s=(0,b.Hc)(t.audio,n),o=new Blob([s],{type:"audio/wav"}),i=await v(t.audio,n);g.current&&URL.revokeObjectURL(g.current),k.current&&URL.revokeObjectURL(k.current);let d=URL.createObjectURL(o),c=URL.createObjectURL(i);g.current=d,k.current=c,T(d),G(c),W(o.size),$(i.size),E(t.device||"wasm"),z(t.model||"Xenova/speecht5_tts"),q(r),J(l),M("".concat(r," preview ready.")),R(""),S(!1),(0,x.nj)({action:"generate",path:"/text-to-voice-changer/",text:l})}catch(e){R((null==e?void 0:e.message)||"The browser could not encode MP3 audio."),M("Audio encoding stopped."),S(!1)}return}"error"===t.type&&(R(t.message||"Voice generation failed in this browser."),M("Voice generation stopped."),S(!1))}},t.current=e,e})().postMessage({id:a,type:"generate",text:e,voicePreset:I,voicePresetLabel:et.label})}
1,disabled:L,className:"h-14 rounded-2xl border-4 border-emerald-800 bg-emerald-700 text-base font-black text-white shadow-[0_8px_0_#065f46] hover:bg-emerald-800 active:translate-y-1 active:shadow-none",children:[L?(0,a.jsx)(n.A,{className:"mr-2 size-5 animate-spin"}):(0,a.jsx)(s.A,{className:"mr-2 size-5"}),"Generate voice"]}),(0,a.jsxs)(c.$,{type:"button",variant:"outline",onClick:function(){N(""),R(""),M("Ready for short English text."),_(null),W(0),$(0),z(""),q(""),J(""),Y(!1),g.current&&(URL.revokeObjectURL(g.current),g.current=""),k.current&&(URL.revokeObjectURL(k.current),k.current=""),T(""),G("")},className:"h-14 rounded-2xl border-4 border-slate-200 bg-white text-base font-black",children:[(0,a.jsx)(o.A,{className:"mr-2 size-5"}),"Clear"]})]}),(0,a.jsx)("div",{className:"mt-5 rounded-[1.5rem] border-2 border-amber-200 bg-amber-50 p-4 text-sm font-bold leading-relaxed text-amber-900",children:"First use downloads a browser TTS model and voice profile. Keep the text short and expect the first run to take longer."})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-[2rem] border-4 border-slate-100 bg-slate-50 p-4 sm:p-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-black uppercase tracking-[0.16em] text-slate-500",children:"Voice result"}),(0,a.jsx)("h3",{className:"mt-2 text-3xl font-black tracking-tighter text-slate-950",children:"Generated audio"})]}),(0,a.jsx)(j,{progress:P})]}),(0,a.jsx)("div",{role:"status","aria-live":"polite",className:"mt-4 rounded-[1.5rem] border-2 border-white bg-white p-4 text-base font-black text-slate-700",children:A}),U?(0,a.jsxs)("div",{className:"mt-4 flex gap-3 rounded-[1.5rem] border-2 border-red-200 bg-red-50 p-4 text-sm font-bold leading-relaxed text-red-800",children:[(0,a.jsx)(i.A,{className:"mt-0.5 size-5 shrink-0"}),(0,a.jsx)("span",{children:U})]}):null,(0,a.jsx)("div",{className:"mt-4 rounded-[1.5rem] border-2 border-white bg-white p-4",children:F?(0,a.jsx)("audio",{controls:!0,src:F,className:"w-full","aria-label":"Generated WAV preview"}):(0,a.jsx)("div",{className:"flex min-h-[4.5rem] items-center justify-center rounded-[1rem] bg-slate-50 text-center text-sm font-black uppercase tracking-[0.14em] text-slate-400",children:"Generate voice to create audio"})}),(0,a.jsxs)("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[1.25rem] border-2 border-white bg-white p-4",children:[(0,a.jsx)("p",{className:"text-xs font-black uppercase tracking-[0.14em] text-slate-400",children:"Voice"}),(0,a.jsx)("p",{className:"mt-1 text-base font-black text-slate-800",children:F?K||"Generated voice":"No audio yet"})]}),(0,a.jsxs)("div",{className:"rounded-[1.25rem] border-2 border-white bg-white p-4",children:[(0,a.jsx)("p",{className:"text-xs font-black uppercase tracking-[0.14em] text-slate-400",children:"File"}),(0,a.jsx)("p",{className:"mt-1 text-base font-black text-slate-800",children:D||O?"".concat(D?"".concat(w(D)," MP3"):"").concat(D&&O?" / ":"").concat(O?"".concat(w(O)," WAV"):""):"No audio yet"})]})]}),(0,a.jsxs)("div",{className:"mt-4 grid min-w-0 gap-3 sm:grid-cols-2",children:[B?(0,a.jsxs)("a",{href:B,download:"textkits-text-to-voice.mp3",onClick:()=>er("mp3"),className:"inline-flex h-14 min-w-0 items-center justify-center gap-2 rounded-2xl border-4 border-emerald-800 bg-emerald-700 px-3 text-sm font-black text-white transition hover:bg-emerald-800 sm:text-base",children:[(0,a.jsx)(d.A,{className:"size-5"}),"Download MP3"]}):(0,a.jsxs)(c.$,{type:"button",disabled:!0,className:"h-14 min-w-0 rounded-2xl border-4 border-emerald-800 bg-emerald-700 px-3 text-sm font-black text-white sm:text-base",children:[(0,a.jsx)(d.A,{className:"mr-2 size-5"}),"Download MP3"]}),F?(0,a.jsxs)("a",{href:F,download:"textkits-text-to-voice.wav",onClick:()=>er("wav"),className:"inline-flex h-14 min-w-0 items-center justify-center gap-2 rounded-2xl border-4 border-slate-200 bg-white px-3 text-sm font-black text-emerald-700 transition hover:bg-slate-50 sm:text-base",children:[(0,a.jsx)(d.A,{className:"size-5"}),"Download WAV"]}):(0,a.jsxs)(c.$,{type:"button",variant:"outline",disabled:!0,className:"h-14 min-w-0 rounded-2xl border-4 border-slate-200 bg-white px-3 text-sm font-black text-emerald-700 sm:text-base",children:[(0,a.jsx)(d.A,{className:"mr-2 size-5"}),"Download WAV"]})]}),Q?(0,a.jsxs)("div",{className:"mt-4 rounded-[1.5rem] border-2 border-blue-200 bg-blue-50 p-4",children:[(0,a.jsx)("p",{className:"text-sm font-black uppercase tracking-[0.14em] text-blue-700",children:"Next audio tool"}),(0,a.jsx)("p",{className:"mt-2 text-sm font-bold leading-relaxed text-blue-900",children:"Download started. If you also need to turn audio back into text, open the Audio to Text Generator."}),(0,a.jsx)("a",{href:"/audio-to-text-generator/",className:"mt-3 inline-flex h-11 items-center justify-center rounded-full border-2 border-blue-700 bg-white px-4 text-sm font-black text-blue-700 transition hover:-translate-y-0.5 hover:bg-blue-100",children:"Open Audio to Text Generator"})]}):null,(0,a.jsx)("div",{className:"mt-4 text-xs font-bold text-slate-500",children:V?"Model: ".concat(V," / Runtime: ").concat(C||"browser worker"):"Model loads only after you click Generate voice."}),(0,a.jsx)(m.Ay,{currentPath:"/text-to-voice-changer/"})]})]})]})}},39867:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(19904).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},52056:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(19904).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},89167:(e,t,r)=>{r.d(t,{C2:()=>a,Hc:()=>d,b1:()=>s,cF:()=>l,ou:()=>o,vk:()=>i});let a=1e3,l=[{key:"product",label:"Product intro",text:"Welcome to TextKits. This short script becomes a downloadable voice preview for your product intro."}];function n(e){return String(null!=e?e:"").replace(/\r\n?/g,"\n").replace(/[ \t]+/g," ").replace(/\n{3,}/g,"\n\n").trim()}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=n(e);return r.length<=t?r:r.slice(0,t).replace(/\s+\S*$/,"").trim()}
1function o(e){let t=n(e).split(/\s+/).filter(Boolean).length,r=Math.max(1,Math.round(t/150*60));return{words:t,seconds:r}}function i(e){if(!Number.isFinite(e)||e<=0)return"0 sec";if(e<60)return"".concat(e," sec");let t=Math.floor(e/60),r=String(e%60).padStart(2,"0");return"".concat(t,":").concat(r)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16e3,r=e instanceof Float32Array?e:new Float32Array(e||[]),a=new ArrayBuffer(44+2*r.length),l=new DataView(a);function n(e,t){for(let r=0;r<t.length;r+=1)l.setUint8(e+r,t.charCodeAt(r))}n(0,"RIFF"),l.setUint32(4,36+2*r.length,!0),n(8,"WAVE"),n(12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,1,!0),l.setUint32(24,t,!0),l.setUint32(28,2*t,!0),l.setUint16(32,2,!0),l.setUint16(34,16,!0),n(36,"data"),l.setUint32(40,2*r.length,!0);let s=44;for(let e of r){let t=Math.max(-1,Math.min(1,e));l.setInt16(s,t<0?32768*t:32767*t,!0),s+=2}return a}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.