PageSourceSearch

https://visro.ai/_nuxt/BPIUNPr9.js

js visro.ai collected 2026-10-05 13:16:08 UTC 6,165 bytes, 1 lines download raw bytes

1import{b as e,o as r,d as a,f as o,t,j as l,a0 as s,c as i,w as n,a as d,z as c,aD as u,ay as p,ak as m,F as f,H as g,aj as w,at as b,s as j,C as v,u as y,A as h,y as S,aq as D,a1 as x,_,a6 as C}from"./CxpHt3i8.js";import{v as k,S as z}from"./BxmXk4u3.js";import{r as R}from"./YYMn0Jc8.js";import{r as U}from"./QiAlKHmJ.js";import{r as V}from"./DGveYHKX.js";import{r as T}from"./B8ZWiN86.js";import{R as A}from"./gYRWqy-o.js";import{s as F}from"./COH8ZT7G.js";import{_ as I}from"./CLiBHw5z.js";import"./DMmAHxXZ.js";import"#entry";import"./Br2DsMp3.js";import"./Bldqe1My.js";import"./C06JTmLM.js";import"./CCwCS0PT.js";import"./gHxtaHIT.js";import"./B7WOy1Yf.js";import"./N8G8b7jw.js";import"./B8UCMiMp.js";import"./jKeUyJ0T.js";import"./_3JMGzsr.js";import"./pOOtZPOT.js";import"./BEeIpIbd.js";import"./_S-yTaLV.js";import"./BnVnsD-J.js";import"./CAggu1Rt.js";import"./CMerHBmm.js";import"./akj3Jn3-.js";import"./DUKZ22yu.js";import"./DoM8llv9.js";import"./BaZ_lN7o.js";function L(o,t){return r(),e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[a("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd"})])}const P={class:"playground"},q={class:"audio-wrapper"},B={class:"playground"},M={class:"audio-wrapper"},O={class:"header"},Y={key:0,class:"name"},H=["src"],K={class:"footer-wrapper"},W=I(o({__name:"RecorderDialog",props:{languageList:{type:Array,default:()=>[]}},emits:["onUploadAudioFile"],setup(o,{expose:I,emit:W}){const E=o,J=W,X=t({show:!1,language:"en",text:l(()=>E.languageList.find(e=>e.value===X.language)?.sample??""),recordState:"none",record:{blobUrl:"",duration:0,file:null,bufferDuration:0},recordConfig:{maxDuration:20}});let Z,G,N;I({openDialog:()=>{X.show=!0,"none"===X.recordState&&_(()=>{Q(()=>{X.recordState="ready"})})}});const Q=e=>{Z=A({type:"mp3",sampleRate:16e3,bitRate:16,onProcess:function(e,r,a,o,t,l){G=Date.now(),N&&N.input(e[e.length-1],r,o),X.record.bufferDuration=a,a>=1e3*X.recordConfig.maxDuration&&ee()}}),Z.open(function(){_(()=>{A.WaveView&&(N=A.WaveView({elem:".recwave"})),e&&e()})},function(e,r){z.fire({icon:"warning",title:"Can not record",text:e,confirmButtonText:"OK, I got it !"}).then(e=>{e.isConfirmed&&(X.show=!1)})})},$=()=>{if("ready"===X.recordState){Z.start(),X.recordState="recording";var e=Z.watchDogTimer=F(function(){Z&&e==Z.watchDogTimer?Date.now()<Z.wdtPauseT||Date.now()-(G||r)>
11500&&clearInterval(e):clearInterval(e)},1e3),r=Date.now();Z.wdtPauseT=0,G=0}else z.fire({icon:"error",title:"Please allow the recording permission first",confirmButtonText:"OK, I got it!"})},ee=()=>{if(Z){Z.pause(),X.recordState="pause";var e=null,r=A.SampleData(Z.buffers,Z.srcSampleRate,Z.srcSampleRate,e);e=r;var a=r.data,o=r.sampleRate,t=A({type:"mp3",bitRate:16,sampleRate:16e3});t.mock(a,o),t.stop(function(e,r){X.record.duration=r;const a=URL.createObjectURL(e);X.record.blobUrl=a},function(e){})}},re=()=>{Z.resume(),X.recordState="recording"},ae=()=>{Z.watchDogTimer=0,Z.stop(function(e,r){const a=new File([e],"record.mp3",{type:"audio/mp3"});J("onUploadAudioFile",{raw:a}),te()},function(e){Z.close(),Z=null})},oe=()=>{Z.stop(function(e,r){X.recordState="ready",X.record={blobUrl:"",duration:0,file:null,bufferDuration:0}},function(e){})},te=()=>{X.recordState="none",X.record={blobUrl:"",duration:0,file:null,bufferDuration:0},Z.close(),Z=null,X.show=!1};return s(()=>{Z?.close(),Z=null}),(o,t)=>{const l=w,s=m,_=p,z=b,A=u,F=D,I=x,W=C;return r(),i(W,{modelValue:X.show,"onUpdate:modelValue":t[2]||(t[2]=e=>X.show=e),title:"Record",class:"element-mobile-full-dialog","before-close":te,"lock-scroll":!0,"append-to-body":""},{default:n(()=>[t[4]||(t[4]=a("p",null,"You can read the following sentences naturally. Please make sure your recording is longer than 10 seconds to ensure the best generation quality.",-1)),d(A,null,{default:n(()=>[d(_,null,{default:n(()=>[d(s,{modelValue:X.language,"onUpdate:modelValue":t[0]||(t[0]=e=>X.language=e),disabled:!1},{default:n(()=>[(r(!0),e(f,null,g(E.languageList,(e,a)=>(r(),i(l,{label:e.label,value:e.value},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1}),d(_,null,{default:n(()=>[d(z,{type:"textarea",modelValue:X.text,"onUpdate:modelValue":t[1]||(t[1]=e=>X.text=e),rows:8,maxlength:"1000","show-word-limit":"",autosize:!1,readonly:!0},null,8,["modelValue"])]),_:1})]),_:1}),c(a("div",P,[a("div",q,[j(v(y(k)(X.record.bufferDuration))+" / "+v(y(k)(1e3*X.recordConfig.maxDuration))+" ",1),t[3]||(t[3]=a("div",{class:"recwave"},null,-1))])],512),[[h,"recording"==X.recordState||"ready"==X.recordState||"none"==X.recordState]]),c(a("div",B,[a("div",M,[a("div",O,[a("div",null,[X.record.file?(r(),e("div",Y,v(X.record.file?.name),1)):S("",!0),X.record.file?(r(),i(F,{key:1,size:"small"},{default:n(()=>[j(v((X.record.file?.size?(X.record.file.size/1024/1024).toFixed(2):"0.00")+"M"),1)]),_:1})):S("",!0),d(F,{size:"small"},{default:n(()=>[j(v(X.record.duration/1e3)+"s",1)]),_:1})])]),d(y(U),{class:"size-6 text-purple-600"}),a("audio",{ref:"audioElement",src:X.record.blobUrl,controls:""},null,8,H)])],512),[[h,!("recording"==X.recordState||"ready"==X.recordState||"none"==X.recordState)]]),a("div",K,[c(d(I,{round:"",onClick:oe},{default:n(()=>[d(y(V),{class:"size-6"})]),_:1},512),[[h,"pause"===X.recordState]]),c(d(I,{disabled:X.record.duration>=1e3*X.recordConfig.maxDuration,onClick:$,type:"danger",circle:""},{default:n(()=>[d(y(T),{class:"size-6"})]),_:1},8,["disabled"]),[[h,"ready"===X.recordState]]),c(d(I,{onClick:ee,type:"danger",circle:""},{default:n(()=>[d(y(L),{class:"size-6"})]),_:1},512),[[h,"recording"===X.recordState]]),c(d(I,{disabled:X.record.duration>=1e3*X.recordConfig.maxDuration,onClick:re,type:"danger",circle:""},{default:n(()=>[d(y(T),{class:"size-6"})]),_:1},8,["disabled"]),[[h,"pause"===X.recordState]]),c(d(I,{round:"",type:"primary",onClick:ae,disabled:X.record.duration<1e4},{default:n(()=>[d(y(R),{class:"size-6"})]),_:1},8,["disabled"]),[[h,"pause"===X.recordState]])])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-20dcf8f8"]]);export{W as default};

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.