Spaces:
Running
Running
Commit
·
a2f2040
1
Parent(s):
51a77ef
release: build de10f5ed8a9e0f9f258447ff9cb627b10f6e5c86
Browse files- assets/{index-ChbYLw6A.js → index-BoAC2APU.js} +1 -1
- assets/worker-Dn3woLrm.js +0 -0
- assets/worker-kV9t-IeA.js +0 -0
- index.html +1 -1
assets/{index-ChbYLw6A.js → index-BoAC2APU.js}
RENAMED
@@ -4012,5 +4012,5 @@ void main() {
|
|
4012 |
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
4013 |
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
4014 |
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
4015 |
-
}`})}}oo.BlurDirectionX=new re(1,0);oo.BlurDirectionY=new re(0,1);const o3=["args","set-size"],a3=["args"],l3=["args","strength"],c3=["set-size"],u3=ir({__name:"BloomScene",props:{frequency:{}},setup(n){const e=n;lu({EffectComposer:t3,OutputPass:i3,UnrealBloomPass:oo,RenderPass:s3});const{renderer:t,scene:i,camera:s,sizes:r}=R2(),o=jn();return P2().render(()=>{o.value&&o.value.render()}),dt([r.width,r.height],()=>{var a;(a=o.value)==null||a.setSize(r.width.value,r.height.value)}),(a,l)=>(Ri(),Pi("TresEffectComposer",{ref_key:"composer",ref:o,args:[mt(t)],"set-size":[mt(r).width.value,mt(r).height.value]},[Rt("TresRenderPass",{args:[mt(i),mt(s)],attach:"passes-0"},null,8,a3),Rt("TresUnrealBloomPass",{args:[[mt(r).width,mt(r).height],.2,1,0],strength:.2+e.frequency/1e3,attach:"passes-1"},null,8,l3),Rt("TresOutputPass",{attach:"passes-2","set-size":[mt(r).width.value,mt(r).height.value]},null,8,c3)],8,o3))}}),B_=16e3,h3="/assets/processor-0sEQXaXZ.js";var Oo=(n=>(n.Status="status",n.Output="output",n.Info="info",n.Request="request",n.Error="error",n.Load="load",n))(Oo||{});const f3="/assets/worker-
|
4016 |
`),u=new Blob([c],{type:"text/plain"}),h=URL.createObjectURL(u),f=document.createElement("a");f.href=h,f.download="transcript.txt",f.click(),URL.revokeObjectURL(h)}return(c,u)=>{const h=fM("motion");return Ri(),Pi("div",d3,[jb((Ri(),Pi("div",p3,u[1]||(u[1]=[Rt("h1",{class:"text-6xl text-white font-bold lg:text-8xl sm:text-7xl"}," Moonshine Web ",-1),Rt("h2",{class:"text-2xl text-white"}," Real-time in-browser speech recognition, powered by Transformers.js ",-1)]))),[[h]]),t.value?(Ri(),Pi("div",m3,[u[2]||(u[2]=Rt("div",{class:"mb-1 text-4xl text-white font-semibold md:text-5xl"}," An error occurred ",-1)),Rt("div",g3,bf(t.value),1)])):(Ri(),Pi(ln,{key:1},[Rt("div",_3,[Jt(CS,{name:"fade-up",tag:"div"},{default:Ef(()=>[(Ri(!0),Pi(ln,null,pM(i.value,f=>(Ri(),Pi("div",{key:f.message||"",initial:{opacity:0,y:25},enter:{opacity:1,y:0},duration:200,class:Ra(["mb-1",[f.type==="output"?"text-5xl":"text-2xl text-green-300 font-light"]])},[Rt("div",null,bf(f.message),1)],2))),128))]),_:1})]),Jt(mt(Qx),{"window-size":"",alpha:!0,antialias:!0,"power-preference":"high-performance","output-color-space":mt(jt),"tone-mapping":mt(ao)},{default:Ef(()=>[u[3]||(u[3]=Rt("TresPerspectiveCamera",{position:[0,0,8],fov:75,near:.1,far:1e3},null,-1)),u[4]||(u[4]=Rt("TresAmbientLight",{intensity:.5},null,-1)),Jt(jU,{ready:e.value!==null,active:e.value==="recording_start",frequency:s.value},null,8,["ready","active","frequency"]),Jt(u3,{frequency:s.value},null,8,["frequency"])]),_:1},8,["output-color-space","tone-mapping"]),Rt("div",v3,[Rt("button",{class:"h-10 w-10 flex items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Download Transcript",onClick:u[0]||(u[0]=()=>l())},u[5]||(u[5]=[Rt("svg",{class:"h-7 w-7 cursor-pointer text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Rt("path",{fillRule:"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",clipRule:"evenodd"}),Rt("path",{fillRule:"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",clipRule:"evenodd"})],-1)])),u[6]||(u[6]=Rt("a",{href:"https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web",target:"_blank",class:"h-10 w-10 flex cursor-pointer items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Source Code"},[Rt("svg",{class:"h-7 w-7 text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Rt("path",{fillRule:"evenodd",d:"M12.006 2a9.847 9.847 0 0 0-6.484 2.44 10.32 10.32 0 0 0-3.393 6.17 10.48 10.48 0 0 0 1.317 6.955 10.045 10.045 0 0 0 5.4 4.418c.504.095.683-.223.683-.494 0-.245-.01-1.052-.014-1.908-2.78.62-3.366-1.21-3.366-1.21a2.711 2.711 0 0 0-1.11-1.5c-.907-.637.07-.621.07-.621.317.044.62.163.885.346.266.183.487.426.647.71.135.253.318.476.538.655a2.079 2.079 0 0 0 2.37.196c.045-.52.27-1.006.635-1.37-2.219-.259-4.554-1.138-4.554-5.07a4.022 4.022 0 0 1 1.031-2.75 3.77 3.77 0 0 1 .096-2.713s.839-.275 2.749 1.05a9.26 9.26 0 0 1 5.004 0c1.906-1.325 2.74-1.05 2.74-1.05.37.858.406 1.828.101 2.713a4.017 4.017 0 0 1 1.029 2.75c0 3.939-2.339 4.805-4.564 5.058a2.471 2.471 0 0 1 .679 1.897c0 1.372-.012 2.477-.012 2.814 0 .272.18.592.687.492a10.05 10.05 0 0 0 5.388-4.421 10.473 10.473 0 0 0 1.313-6.948 10.32 10.32 0 0 0-3.39-6.165A9.847 9.847 0 0 0 12.007 2Z",clipRule:"evenodd"})])],-1))])],64))])}}}),y3=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},b3=y3(x3,[["__scopeId","data-v-820e08ca"]]);OS(b3).use(WU).use(j2).mount("#app");
|
|
|
4012 |
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
4013 |
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
4014 |
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
4015 |
+
}`})}}oo.BlurDirectionX=new re(1,0);oo.BlurDirectionY=new re(0,1);const o3=["args","set-size"],a3=["args"],l3=["args","strength"],c3=["set-size"],u3=ir({__name:"BloomScene",props:{frequency:{}},setup(n){const e=n;lu({EffectComposer:t3,OutputPass:i3,UnrealBloomPass:oo,RenderPass:s3});const{renderer:t,scene:i,camera:s,sizes:r}=R2(),o=jn();return P2().render(()=>{o.value&&o.value.render()}),dt([r.width,r.height],()=>{var a;(a=o.value)==null||a.setSize(r.width.value,r.height.value)}),(a,l)=>(Ri(),Pi("TresEffectComposer",{ref_key:"composer",ref:o,args:[mt(t)],"set-size":[mt(r).width.value,mt(r).height.value]},[Rt("TresRenderPass",{args:[mt(i),mt(s)],attach:"passes-0"},null,8,a3),Rt("TresUnrealBloomPass",{args:[[mt(r).width,mt(r).height],.2,1,0],strength:.2+e.frequency/1e3,attach:"passes-1"},null,8,l3),Rt("TresOutputPass",{attach:"passes-2","set-size":[mt(r).width.value,mt(r).height.value]},null,8,c3)],8,o3))}}),B_=16e3,h3="/assets/processor-0sEQXaXZ.js";var Oo=(n=>(n.Status="status",n.Output="output",n.Info="info",n.Request="request",n.Error="error",n.Load="load",n))(Oo||{});const f3="/assets/worker-Dn3woLrm.js";function z_(n){return new Date(n).toLocaleString("zh",{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3})}const d3={class:"h-full w-screen flex flex-col items-center justify-center bg-gray-900"},p3={initial:{opacity:0},enter:{opacity:100},visible:{opacity:0},class:"fixed inset-0 z-20 h-full w-full flex flex-col items-center justify-center bg-black/90 p-2 text-center text-black backdrop-blur-md transition-all duration-2000 delay-1500 ease-in-out"},m3={key:0,class:"h-full flex flex-col justify-center p-2 text-center"},g3={class:"text-xl text-red-300"},_3={class:"absolute bottom-0 z-10 w-full overflow-hidden pb-8 text-center text-white"},v3={class:"absolute bottom-6 right-6 z-10 flex flex-col space-y-2"},x3=ir({__name:"App",setup(n){const e=Fe(null),t=Fe(null),i=Fe([]),s=Fe(0),{post:r,data:o}=xI(f3,{type:"module"});function a(c){t.value=c.message}dt(o,()=>{if("error"in o.value)return a(o.value.error);o.value.type===Oo.Status?(e.value=o.value.message,i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1))):(i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1)))}),as(()=>{r({type:Oo.Load})}),as(()=>{let c=!1;const u=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,sampleRate:B_}});let h,f,d;return u.then(async p=>{if(c)return;f=new(window.AudioContext||"webkitAudioContext"in window&&window.webkitAudioContext)({sampleRate:B_,latencyHint:"interactive"});const _=f.createAnalyser();_.fftSize=32,d=f.createMediaStreamSource(p),d.connect(_);const g=new Uint8Array(_.frequencyBinCount),m=()=>(_.getByteFrequencyData(g),g.reduce((x,v)=>x+v,0)/g.length),y=()=>{const x=m();s.value=x,requestAnimationFrame(y)};y(),await f.audioWorklet.addModule(new URL(h3,import.meta.url)),h=new AudioWorkletNode(f,"vad-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"}),d.connect(h),h.port.onmessage=x=>{const{buffer:v}=x.data;r({type:Oo.Request,buffer:v})}}).catch(p=>{t.value=p.message,console.error(p)}),()=>{c=!0,u.then(p=>p.getTracks().forEach(_=>_.stop())),d==null||d.disconnect(),h==null||h.disconnect(),f==null||f.close()}});function l(){const c=i.value.filter(d=>d.type===Oo.Output).map(d=>`${z_(d.start)} - ${z_(d.end)} | ${d.message}`).join(`
|
4016 |
`),u=new Blob([c],{type:"text/plain"}),h=URL.createObjectURL(u),f=document.createElement("a");f.href=h,f.download="transcript.txt",f.click(),URL.revokeObjectURL(h)}return(c,u)=>{const h=fM("motion");return Ri(),Pi("div",d3,[jb((Ri(),Pi("div",p3,u[1]||(u[1]=[Rt("h1",{class:"text-6xl text-white font-bold lg:text-8xl sm:text-7xl"}," Moonshine Web ",-1),Rt("h2",{class:"text-2xl text-white"}," Real-time in-browser speech recognition, powered by Transformers.js ",-1)]))),[[h]]),t.value?(Ri(),Pi("div",m3,[u[2]||(u[2]=Rt("div",{class:"mb-1 text-4xl text-white font-semibold md:text-5xl"}," An error occurred ",-1)),Rt("div",g3,bf(t.value),1)])):(Ri(),Pi(ln,{key:1},[Rt("div",_3,[Jt(CS,{name:"fade-up",tag:"div"},{default:Ef(()=>[(Ri(!0),Pi(ln,null,pM(i.value,f=>(Ri(),Pi("div",{key:f.message||"",initial:{opacity:0,y:25},enter:{opacity:1,y:0},duration:200,class:Ra(["mb-1",[f.type==="output"?"text-5xl":"text-2xl text-green-300 font-light"]])},[Rt("div",null,bf(f.message),1)],2))),128))]),_:1})]),Jt(mt(Qx),{"window-size":"",alpha:!0,antialias:!0,"power-preference":"high-performance","output-color-space":mt(jt),"tone-mapping":mt(ao)},{default:Ef(()=>[u[3]||(u[3]=Rt("TresPerspectiveCamera",{position:[0,0,8],fov:75,near:.1,far:1e3},null,-1)),u[4]||(u[4]=Rt("TresAmbientLight",{intensity:.5},null,-1)),Jt(jU,{ready:e.value!==null,active:e.value==="recording_start",frequency:s.value},null,8,["ready","active","frequency"]),Jt(u3,{frequency:s.value},null,8,["frequency"])]),_:1},8,["output-color-space","tone-mapping"]),Rt("div",v3,[Rt("button",{class:"h-10 w-10 flex items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Download Transcript",onClick:u[0]||(u[0]=()=>l())},u[5]||(u[5]=[Rt("svg",{class:"h-7 w-7 cursor-pointer text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Rt("path",{fillRule:"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",clipRule:"evenodd"}),Rt("path",{fillRule:"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",clipRule:"evenodd"})],-1)])),u[6]||(u[6]=Rt("a",{href:"https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web",target:"_blank",class:"h-10 w-10 flex cursor-pointer items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Source Code"},[Rt("svg",{class:"h-7 w-7 text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Rt("path",{fillRule:"evenodd",d:"M12.006 2a9.847 9.847 0 0 0-6.484 2.44 10.32 10.32 0 0 0-3.393 6.17 10.48 10.48 0 0 0 1.317 6.955 10.045 10.045 0 0 0 5.4 4.418c.504.095.683-.223.683-.494 0-.245-.01-1.052-.014-1.908-2.78.62-3.366-1.21-3.366-1.21a2.711 2.711 0 0 0-1.11-1.5c-.907-.637.07-.621.07-.621.317.044.62.163.885.346.266.183.487.426.647.71.135.253.318.476.538.655a2.079 2.079 0 0 0 2.37.196c.045-.52.27-1.006.635-1.37-2.219-.259-4.554-1.138-4.554-5.07a4.022 4.022 0 0 1 1.031-2.75 3.77 3.77 0 0 1 .096-2.713s.839-.275 2.749 1.05a9.26 9.26 0 0 1 5.004 0c1.906-1.325 2.74-1.05 2.74-1.05.37.858.406 1.828.101 2.713a4.017 4.017 0 0 1 1.029 2.75c0 3.939-2.339 4.805-4.564 5.058a2.471 2.471 0 0 1 .679 1.897c0 1.372-.012 2.477-.012 2.814 0 .272.18.592.687.492a10.05 10.05 0 0 0 5.388-4.421 10.473 10.473 0 0 0 1.313-6.948 10.32 10.32 0 0 0-3.39-6.165A9.847 9.847 0 0 0 12.007 2Z",clipRule:"evenodd"})])],-1))])],64))])}}}),y3=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},b3=y3(x3,[["__scopeId","data-v-820e08ca"]]);OS(b3).use(WU).use(j2).mount("#app");
|
assets/worker-Dn3woLrm.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
assets/worker-kV9t-IeA.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
index.html
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
document.documentElement.classList.toggle('dark', true)
|
14 |
})()
|
15 |
</script>
|
16 |
-
<script type="module" crossorigin src="/assets/index-
|
17 |
<link rel="stylesheet" crossorigin href="/assets/index-NxcRAxmX.css">
|
18 |
</head>
|
19 |
<body class="font-sans">
|
|
|
13 |
document.documentElement.classList.toggle('dark', true)
|
14 |
})()
|
15 |
</script>
|
16 |
+
<script type="module" crossorigin src="/assets/index-BoAC2APU.js"></script>
|
17 |
<link rel="stylesheet" crossorigin href="/assets/index-NxcRAxmX.css">
|
18 |
</head>
|
19 |
<body class="font-sans">
|