PageSourceSearch

https://dubbingai.io/assets/ConverterView-wZsg7tAI.js

js dubbingai.io collected 2026-10-02 08:46:09 UTC 15,162 bytes, 5 lines download raw bytes

1import{r as l,j as r}from"./r-vendor-CJzW6nL1.js";import{H as X,I as Y,u as st,z as at,b as ct,c6 as it,F as lt,S as ut,i as q,b0 as xe,c1 as dt,c2 as pt,l as _t,c3 as ft}from"./app-Duxr4CVW.js";import{D as mt}from"./DubbingInfoBottom-CvatlFIT.js";import{M as gt}from"./MessageDialog-Duk6Tz4W.js";import{g as vt}from"./audio-DwmQXxVt.js";import{u as ht,a as jt,s as xt,c as kt,b as bt}from"./close-BxGFZ7NJ.js";import{A as ke,u as wt}from"./upload2-CsEt4Let.js";import{O as Nt,a as yt}from"./OnlineVoiceChangerAdvantage-C8jp02rN.js";import{O as Ft}from"./OnlineVoiceChangerFaq-DxidsC_T.js";import{A as St}from"./AppBreadcrumb-BjDYBD7a.js";import{l as Tt}from"./loading-Cylzba4x.js";import"./format-yhvIsj8L.js";const Ut=async({fileKey:t,inputFormat:c,outputFormat:i})=>await X({url:Y("/api/officialSite/audioconv/createVcTask"),method:"post",data:{fileKey:t,inputFormat:c,outputFormat:i}}),It=async({taskId:t})=>await X({url:Y("/api/officialSite/audioconv/getVcTaskInfo"),method:"get",params:{taskId:t}}),Rt=async t=>await X({url:Y("/api/officialSite/audioconv/getTrialCount"),method:"get",params:t}),Ct="_container_fkjno_1",Ot="_wrapper_fkjno_11",Dt="_top_fkjno_20",At="_title_fkjno_24",$t="_desc_fkjno_32",Pt="_name_fkjno_55",qt="_radio_fkjno_72",Et="_label_fkjno_92",Lt="_active_fkjno_113",Mt="_quota_fkjno_145",Vt="_center_fkjno_155",Kt="_highlight_fkjno_159",Bt="_uploading_fkjno_163",zt="_text_fkjno_175",Gt="_progress_fkjno_183",Qt="_circle_fkjno_198",Jt="_percentage_fkjno_221",Ht="_cancel_fkjno_228",Wt="_icon_fkjno_241",Xt="_player_fkjno_304",Yt="_loading_fkjno_331",Zt="_advantage_fkjno_368",er="_faq_fkjno_373",tr="_dubbingInfoBottom_fkjno_377",n={container:Ct,wrapper:Ot,top:Dt,title:At,desc:$t,"convert-options":"_convert-options_fkjno_42","option-wrapper":"_option-wrapper_fkjno_49",name:Pt,"option-list":"_option-list_fkjno_62","option-item":"_option-item_fkjno_67",radio:qt,label:Et,"upload-area":"_upload-area_fkjno_101",active:Lt,"file-label":"_file-label_fkjno_127",quota:Mt,center:Vt,highlight:Kt,uploading:Bt,text:zt,progress:Gt,"flex-wrapper":"_flex-wrapper_fkjno_187","circular-chart":"_circular-chart_fkjno_192","circle-bg":"_circle-bg_fkjno_198",circle:Qt,percentage:Jt,cancel:Ht,icon:Wt,"origin-file-prepare":"_origin-file-prepare_fkjno_245","re-upload":"_re-upload_fkjno_289",player:Xt,"start-process":"_start-process_fkjno_309",loading:Yt,"download-wrapper":"_download-wrapper_fkjno_335","new-separation":"_new-separation_fkjno_348","convert-steps":"_convert-steps_fkjno_364",advantage:Zt,faq:er,dubbingInfoBottom:tr},rr="https://dvi.dubbingai.io",f=1,P=2,x=3,d=4,h=5,nr=5,or=600,sr=1024*1024*100,m=[{id:"mp3",name:"MP3"},{id:"wav",name:"WAV"},{id:"mp4",name:"MP4"},{id:"ogg",name:"OGG"},{id:"flac",name:"FLAC"},{id:"m4a",name:"M4A"}],ar=m.map(t=>`.${t.id}`).join(","),be=ft.create(),cr=()=>{const t=new Date,c=i=>String(i).padStart(2,"0");return`${t.getFullYear()}${c(t.getMonth()+1)}${c(t.getDate())}${c(t.getHours())}${c(t.getMinutes())}${c(t.getSeconds())}`},we=(t,c)=>{var g,s;let i;if(q){const _=new RegExp(`${c}/((?<output>.+)-converter|(?<input>.+)-to-(?<output>.+))`);i=t.match(_)}else{const _=new RegExp(`${c}/(?<input>.+)-to-(?<output>.+)`),k=new RegExp(`${c}/(?<output>.+)-converter`);i=t.match(_)||t.match(k)}return{input:(g=i==null?void 0:i.groups)==null?void 0:g.input,output:(s=i==null?void 0:i.groups)==null?void 0:s.output}},p=t=>{const[c,i]=l.useState(t),g=l.useRef(c);return[c,g,_=>{g.current=typeof _=="function"?_(g.current):_,i(g.current)}]};function xr(){var je;const{t}=st(),c=at(),i=ct("/converter"),g=we(c.pathname,i),[s,_,k]=p(f),[U,b,I]=p(g.input),[w,N,R]=p(g.output),[E,,O]=p(!1),[,Ne,Z]=p({name:""}
1),[ee,te]=l.useState(""),[re,,ne]=p(0),[,L,oe]=p(""),[ye,Fe,Se]=p(5),[Te,,se]=p(""),[,ae,ce]=p(""),[Ue,M,ie]=p(""),[,Ie,le]=p(!1),[V,,ue]=p(0),y=l.useRef(null),S=l.useRef(null),de=l.useRef(null),Re=l.useRef(null),K=l.useRef(!1),B=l.useRef(!0),pe=l.useRef(!0),_e=l.useRef(!0),z=l.useRef(null),fe=l.useRef(null),G=l.useRef(null),Ce=it(c.pathname).slice(1),Q=()=>{const e=m.find(a=>a.id===b.current),o=m.find(a=>a.id===N.current);return t(o?e?`converter_top_title_${e.id}_to_${o.id}`:`converter_top_title_${o.id}`:"converter_top_title")},Oe=()=>{const e=m.find(a=>a.id===b.current),o=m.find(a=>a.id===N.current);return t(o?e?`converter_seo_description_${e.id}_to_${o.id}`:`converter_seo_description_${o.id}`:"converter_seo_description")},De=e=>{b.current===e?I(""):I(e)},Ae=e=>{N.current===e?R(""):R(e)};l.useEffect(()=>{if(pe.current){pe.current=!1;return}if(B.current){B.current=!1;return}let e=i;w&&(U?e=`${e}/${U}-to-${w}`:e=`${e}/${w}-converter`),K.current=!0,lt(e)},[U,w]);const $e=()=>{if(K.current){K.current=!1;return}const{input:e,output:o}=we(c.pathname,i);I(e),R(o),B.current=!0};l.useEffect(()=>{if(_e.current){_e.current=!1;return}$e()},[c.pathname]);const v=e=>{e&&k(e);const o={name:Ne.current.name},a={status:_.current,originFile:o,uploadFileKey:L.current,outputFormat:N.current,inputFormat:b.current,originUrl:`${rr}/${L.current}`,processTaskId:ae.current,processedUrl:M.current};q&&localStorage.setItem("data.converter",JSON.stringify(a))},Pe=JSON.stringify({status:f,uploadProgress:0,uploadFileKey:"",outputFormat:"",inputFormat:"",originUrl:"",processTaskId:"",processedPlayerRef:null,processedUrl:""}),qe=()=>{var a;const e=q&&localStorage.getItem("data.converter")||Pe,o=JSON.parse(e);k(o.status),Z(o.originFile),te(((a=o.originFile)==null?void 0:a.name)||""),oe(o.uploadFileKey),R(o.outputFormat||N.current),I(o.inputFormat||b.current),se(o.originUrl),ce(o.processTaskId),ie(o.processedUrl),o.status===d&&he()},J=async()=>{if(!xe())return;const e=await Rt({inputFormat:b.current});if(e.code!==0)return;let o=e.data.total-e.data.usedCount;o<0&&(o=0),Se(o)};l.useEffect(()=>(J(),qe(),()=>{G.current&&clearInterval(G.current)}),[]);const Ee=e=>{S.current.show({message:e,button1ShowIcon:!1,button2Text:""})},C=()=>Fe.current<=0?(Ee(t("converter_message_quota_limit")),!1):!0,D=(e,o=t("converter_upload_error_title"))=>{S.current.show({title:o,message:e,button1Text:t("converter_upload_error_reupload"),button1ShowIcon:!0,button2Text:""})},H=(e,o)=>{S.current.show({message:e,button1Text:t("converter_confirm_button1_text"),button2Text:t("converter_confirm_button2_text"),button1Callback:()=>{o(),S.current.close()}})},me=e=>{S.current.show({message:t("converter_overload_message"),type:"overload",button1Text:t("converter_overload_button_try"),closeCallback:e})},W=e=>e.split(".").pop().toLowerCase(),Le=()=>{_.current!==d&&H(t("converter_confirm_reupload"),()=>{v(f),y.current&&(y.current.value="")}
1)},Me=()=>{O(!0)},Ve=()=>{O(!1)},Ke=e=>{if(!C()){e.preventDefault();return}O(!0),y.current.click()},Be=e=>{C()&&ge(e.dataTransfer.files)},ze=e=>{ge(e.target.files)},Ge=async e=>{if(!C()||!(e!=null&&e.length))return!1;const o=e[0],a=m.map(A=>A.id),F=W(o.name);if(a.indexOf(F)===-1)return D(t("converter_upload_error_format")),!1;const j=await vt(o);return j<=0||j>or?(D(t("converter_upload_error_time")),!1):o.size>sr?(D(t("converter_upload_error_size")),!1):!0},Qe=e=>{ne(Math.round(e.progress*100))},Je=async({file:e,url:o})=>{if(!C())return;z.current=new AbortController;const a=await be.put(o,e,{signal:z.current.signal,onUploadProgress:Qe});return a.status!==200&&(console.error("upload failed: ",a),D(t("converter_upload_error_failed"))),a},ge=async e=>{var A;if(O(!1),!await Ge(e))return;const a=e[0];Z(a),te(a.name),se(URL.createObjectURL(a));const F=W(a.name);if(I(F),F===N.current){const $=((A=m.find(ot=>ot.id!==F))==null?void 0:A.id)||m[0].id;R($)}ne(0),k(P);const j=await bt({ext:F,uploadType:60,provider:1});if(j.code!==0){v(f);return}const T=j.data.token;oe(j.data.fileKey);try{if((await Je({file:a,url:T})).status!==200){v(f);return}}catch($){v(f),console.error("uploadFile error: ",$);return}v(x)},He=()=>{H(t("converter_cancel_upload"),()=>{var e,o;(o=(e=z.current)==null?void 0:e.abort)==null||o.call(e),v(f),y.current&&(y.current.value="")}
1)},ve=()=>b.current&&N.current,he=()=>{const e=setInterval(async()=>{const o=await It({taskId:ae.current});if(o.code!==0||o.data.status===dt){me(()=>{v(x)}),clearInterval(e);return}o.data.status===pt&&(ie(o.data.url),v(h),clearInterval(e))},5e3);G.current=e},We=async()=>{if(!ve()||_.current===d)return;if(k(d),!xe()){_t.emit("showNeedLoginDialog",{origin:Ce}),k(x);return}if(await J(),!C()){k(x);return}de.current.stop();const e={fileKey:L.current,inputFormat:b.current,outputFormat:N.current},o=await Ut(e);if(o.code!==0){me(()=>{v(x)});return}J(),ce(o.data.taskId),he()},Xe=e=>{ue(Math.round(e.progress*100))},Ye=()=>V<=0||V>=100?"":`(${V}%)`,Ze=async()=>{if(Ie.current)return;le(!0);const e=cr(),o=W(M.current);try{fe.current=new AbortController,ue(0);const F=(await be.get(M.current,{signal:fe.current.signal,onDownloadProgress:Xe,responseType:"blob"})).data,j=URL.createObjectURL(F),T=document.createElement("a");T.download=`DubbingAI-${e}-converter.${o}`,T.href=j,T.click(),URL.revokeObjectURL(j)}catch(a){console.error("download error: ",a)}finally{le(!1)}},et=()=>{H(t("converter_start_new_separation"),()=>{v(f),y.current&&(y.current.value="")}
1)},tt=[{desc:t("converter_step_1")},{desc:t("converter_step_2")},{desc:t("converter_step_3")}],rt=[{title:t("converter_advantage_title_1"),desc:t("converter_advantage_desc_1")},{title:t("converter_advantage_title_2"),desc:t("converter_advantage_desc_2")},{title:t("converter_advantage_title_3"),desc:t("converter_advantage_desc_3")},{title:t("converter_advantage_title_4"),desc:t("converter_advantage_desc_4")}],nt=[{title:t("converter_faq_title1"),desc:t("converter_faq_desc1")},{title:t("converter_faq_title2"),desc:t("converter_faq_desc2")},{title:t("converter_faq_title3"),desc:t("converter_faq_desc3")},{title:t("converter_faq_title4"),desc:t("converter_faq_desc4")}],u=e=>e?void 0:{display:"none"};return r.jsxs("div",{className:n.container,children:[r.jsx(ut,{title:t("converter_seo_title",{defaultValue:Q()}),meta:[{name:"description",content:Oe()}],link:[{rel:"canonical",href:q?window.location.href:""}]}),r.jsx(St,{currentName:w?Q():"",style:{alignSelf:"flex-start",marginTop:"10px"}}),r.jsxs("div",{className:n.wrapper,children:[r.jsxs("div",{className:n.top,style:u(s!==P),children:[r.jsx("h1",{className:n.title,children:Q()}),r.jsx("p",{className:n.desc,style:u(s===f),children:t("converter_top_description")})]}),r.jsxs("div",{className:n["convert-options"],style:u(s===f||s===x||s===d),children:[r.jsxs("div",{className:n["option-wrapper"],children:[r.jsx("span",{className:n.name,children:t("converter_convert_from")}),r.jsx("ul",{className:n["option-list"],children:m.map(e=>r.jsxs("li",{className:n["option-item"],children:[r.jsx("input",{className:n.radio,type:"radio",id:`input-format-${e.id}`,checked:U===e.id,disabled:s===x||s===d||w===e.id,onChange:()=>{},onClick:()=>De(e.id)}),r.jsx("label",{className:n.label,htmlFor:`input-format-${e.id}`,children:e.name})]},e.id))})]}),r.jsxs("div",{className:n["option-wrapper"],children:[r.jsx("span",{className:n.name,children:t("converter_convert_to")}),r.jsx("ul",{className:n["option-list"],children:m.map(e=>r.jsxs("li",{className:n["option-item"],children:[r.jsx("input",{className:n.radio,type:"radio",id:`output-format-${e.id}`,checked:w===e.id,disabled:s===d||U===e.id,onChange:()=>{},onClick:()=>Ae(e.id)}),r.jsx("label",{className:n.label,htmlFor:`output-format-${e.id}`,children:e.name})]},e.id))})]})]}),r.jsxs("div",{className:`${n["upload-area"]} ${E?n.active:""}`,style:u(s===f),onDrop:e=>{e.preventDefault(),Be(e)},onDragEnter:e=>{e.preventDefault(),Me()},onDragLeave:e=>{e.preventDefault(),Ve()},onDragOver:e=>e.preventDefault(),onClick:Ke,children:[r.jsx("img",{style:u(!E),src:ht,alt:"upload"}),r.jsx("img",{style:u(E),src:jt,alt:"upload"}),r.jsxs("div",{className:n.title,children:[t("converter_upload_area_title_1")," ",r.jsx("label",{className:n["file-label"],children:t("converter_upload_area_title_2")}),r.jsx("input",{ref:y,type:"file",name:"file",id:"select-file",accept:ar,style:{display:"none"},onChange:ze})]}),r.jsxs("div",{className:n.desc,children:[t("converter_upload_area_desc_1"),r.jsx("br",{}),t("converter_upload_area_desc_2"),r.jsx("br",{}),t("converter_upload_area_desc_3")]})]}),r.jsxs("div",{className:n.uploading,style:u(s===P),children:[r.jsxs("div",{className:n.title,children:[r.jsx("img",{src:xt,alt:"icon",className:n.icon}),r.jsx("div",{className:n.text,children:ee})]}),r.jsx("div",{className:n.progress,children:r.jsx("div",{className:n["flex-wrapper"],children:r.jsxs("svg",{viewBox:"0 0 36 36",className:n["circular-chart"],children:[r.jsx("path",{className:n["circle-bg"],d:`M18 2.0845
2                  a 15.9155 15.9155 0 0 1 0 31.831
3                  a 15.9155 15.9155 0 0 1 0 -31.831`}),r.jsx("path",{className:n.circle,strokeDasharray:`${re}, 100`,d:`M18 2.0845
4                  a 15.9155 15.9155 0 0 1 0 31.831
5                  a 15.9155 15.9155 0 0 1 0 -31.831`}),r.jsxs("text",{x:"18",y:"20.35",className:n.percentage,children:[re,"%"]})]})})}),r.jsxs("button",{className:n.cancel,type:"button",onClick:He,children:[r.jsx("span",{className:n.text,children:t("converter_uploading_cancel")}),r.jsx("img",{src:kt,alt:"icon",className:n.icon})]})]}),(s===x||s===d||s===h)&&r.jsxs("div",{className:n["origin-file-prepare"],children:[r.jsxs("div",{className:n.title,style:u(s!==h),children:[r.jsxs("span",{className:n.name,children:[r.jsx("span",{children:t("converter_uploaded_origin")}),r.jsx("span",{className:n.text,children:ee})]}),r.jsx("button",{className:n["re-upload"],type:"button",onClick:Le,disabled:s===d,style:u(s!==h),children:t("converter_uploaded_reupload")})]}),r.jsx(ke,{ref:de,className:n.player,audioUrl:Te,disabled:s===d,style:u(s!==h)}),r.jsx("div",{className:n.title,style:u(s===h),children:r.jsxs("span",{className:n.name,children:[t("converter_processed_preview")," ",r.jsx("span",{className:n.text,children:(je=m.find(e=>e.id===w))==null?void 0:je.name})]})}),r.jsx(ke,{ref:Re,className:n.player,audioUrl:Ue,disabled:s===d,style:u(s===h)}),r.jsxs("button",{className:n["start-process"],disabled:!ve(),onClick:We,type:"button",style:u(s!==h),children:[s===d&&r.jsx("img",{src:Tt,alt:"loading",className:n.loading}),t(s===d?"converter_processing":"converter_start_process")]}),r.jsxs("div",{className:n["download-wrapper"],style:u(s===h),children:[r.jsxs("button",{className:n["start-process"],onClick:Ze,type:"button",children:[t("converter_processed_download"),Ye()]}),r.jsxs("button",{className:n["new-separation"],type:"button",onClick:et,children:[r.jsx("img",{src:wt,alt:"icon",className:n.icon}),t("converter_processed_new_separation")]})]})]}),r.jsxs("div",{className:`${n.quota} ${s===h?n.center:""}`,style:u(s!==P&&s!==x&&s!==d),children:[t("converter_quota_1")," ",r.jsxs("span",{className:n.highlight,children:[ye,"/",nr]})," ",t("converter_quota_2")]}),r.jsx(gt,{ref:S})]}),r.jsx(Nt,{className:n["convert-steps"],title:t("converter_step_title"),title2:t("converter_step_title2"),steps:tt}),r.jsx(yt,{className:n.advantage,title:t("converter_advantage_title"),items:rt}),r.jsx(Ft,{className:n.faq,title:t("converter_faq_title"),items:nt}),r.jsx(mt,{className:n.dubbingInfoBottom})]})}
5export{xr 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.