From 61ec07358d136a1a4fee667d4c5e1ad3a2cda209 Mon Sep 17 00:00:00 2001 From: Ciaran O'Reilly Date: Sun, 27 Oct 2024 09:00:05 +0100 Subject: [PATCH] Fix typo in Grau gender in dub editor --- static/js/subdub-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/subdub-editor.js b/static/js/subdub-editor.js index e8891d8..46bac18 100644 --- a/static/js/subdub-editor.js +++ b/static/js/subdub-editor.js @@ -168,7 +168,7 @@ and limitations under the License. `,fn=ae.label` font-size: 14px; color: ${we.text}; -`;var Nt=[];for(var Td=0;Td<256;++Td)Nt.push((Td+256).toString(16).slice(1));function GD(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}var Kl,YD=new Uint8Array(16);function XD(){if(!Kl&&(Kl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Kl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Kl(YD)}var QD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const gy={randomUUID:QD};function Mu(e,t,n){if(gy.randomUUID&&!t&&!e)return gy.randomUUID();e=e||{};var r=e.random||(e.rng||XD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return GD(r)}const ZD="https://api.softcatala.org/dubbing-service/v1";class JD{constructor(){this.providerName="matxa",this.voiceList=[{name:"quim-balear",id:"0",gender:"male",language:"cat",region:"balear",label:"Home - Balear (Quim)",provider:this.providerName},{name:"olga-balear",id:"1",gender:"female",language:"cat",region:"balear",label:"Dona - Balear (Olga)",provider:this.providerName},{name:"grau-central",id:"2",gender:"male",language:"cat",region:"central",label:"Dona - Central (Grau)",provider:this.providerName},{name:"elia-central",id:"3",gender:"female",language:"cat",region:"central",label:"Dona - Central (Èlia)",provider:this.providerName},{name:"pere-nord",id:"4",gender:"male",language:"cat",region:"nord",label:"Home - Nord-occidental (Pere)",provider:this.providerName},{name:"emma-nord",id:"5",gender:"female",language:"cat",region:"nord",label:"Dona - Nord-occidental (Emma)",provider:this.providerName},{name:"lluc-valencia",id:"6",gender:"male",language:"cat",region:"valencia",label:"Home - Valencià (Lluc)",provider:this.providerName},{name:"gina-valencia",id:"7",gender:"female",language:"cat",region:"valencia",label:"Dona - Valencià (Gina)",provider:this.providerName}]}async voices(){return this.voiceList}async speak(t,n){const r=`${ZD}/speak/?text=${encodeURIComponent(t)}&voice=${n.id}`;try{const o=await fetch(r);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.arrayBuffer()}catch(o){throw console.error("Error generating speech:",o),o}}getVoice(t){return this.voiceList.find(n=>n.id===t)||this.voiceList[0]}getProviderName(){return this.providerName}}const _a=new JD,Rd=()=>"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");class qD{constructor(){this.speakers=[]}setSpeakers(t){this.speakers=t.map(n=>({id:n.id||Mu(),name:n.name||"",voice:n.voice||_a.getVoice("0"),color:n.color||Rd()})).sort((n,r)=>n.name.localeCompare(r.name))}setSpeaker(t){this.speakers.find(n=>n.id===t.id)?this.updateSpeaker(t.id,t):this.speakers.push({id:t.id,name:t.name||"",voice:t.voice||_a.getVoice("0"),color:t.color||Rd()})}getSpeakers(){return this.speakers}addSpeaker(t,n){this.speakers.push({id:Mu(),name:t,voice:n,color:Rd()})}updateSpeaker(t,n){const r=this.speakers.findIndex(o=>o.id===t);r!==-1&&(this.speakers[r]={...this.speakers[r],...n})}getSpeakerById(t){return this.speakers.find(n=>n.id===t)||this.speakers[0]}}const En=new qD,eI=ae.div` +`;var Nt=[];for(var Td=0;Td<256;++Td)Nt.push((Td+256).toString(16).slice(1));function GD(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}var Kl,YD=new Uint8Array(16);function XD(){if(!Kl&&(Kl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Kl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Kl(YD)}var QD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const gy={randomUUID:QD};function Mu(e,t,n){if(gy.randomUUID&&!t&&!e)return gy.randomUUID();e=e||{};var r=e.random||(e.rng||XD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return GD(r)}const ZD="https://api.softcatala.org/dubbing-service/v1";class JD{constructor(){this.providerName="matxa",this.voiceList=[{name:"quim-balear",id:"0",gender:"male",language:"cat",region:"balear",label:"Home - Balear (Quim)",provider:this.providerName},{name:"olga-balear",id:"1",gender:"female",language:"cat",region:"balear",label:"Dona - Balear (Olga)",provider:this.providerName},{name:"grau-central",id:"2",gender:"male",language:"cat",region:"central",label:"Home - Central (Grau)",provider:this.providerName},{name:"elia-central",id:"3",gender:"female",language:"cat",region:"central",label:"Dona - Central (Èlia)",provider:this.providerName},{name:"pere-nord",id:"4",gender:"male",language:"cat",region:"nord",label:"Home - Nord-occidental (Pere)",provider:this.providerName},{name:"emma-nord",id:"5",gender:"female",language:"cat",region:"nord",label:"Dona - Nord-occidental (Emma)",provider:this.providerName},{name:"lluc-valencia",id:"6",gender:"male",language:"cat",region:"valencia",label:"Home - Valencià (Lluc)",provider:this.providerName},{name:"gina-valencia",id:"7",gender:"female",language:"cat",region:"valencia",label:"Dona - Valencià (Gina)",provider:this.providerName}]}async voices(){return this.voiceList}async speak(t,n){const r=`${ZD}/speak/?text=${encodeURIComponent(t)}&voice=${n.id}`;try{const o=await fetch(r);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.arrayBuffer()}catch(o){throw console.error("Error generating speech:",o),o}}getVoice(t){return this.voiceList.find(n=>n.id===t)||this.voiceList[0]}getProviderName(){return this.providerName}}const _a=new JD,Rd=()=>"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");class qD{constructor(){this.speakers=[]}setSpeakers(t){this.speakers=t.map(n=>({id:n.id||Mu(),name:n.name||"",voice:n.voice||_a.getVoice("0"),color:n.color||Rd()})).sort((n,r)=>n.name.localeCompare(r.name))}setSpeaker(t){this.speakers.find(n=>n.id===t.id)?this.updateSpeaker(t.id,t):this.speakers.push({id:t.id,name:t.name||"",voice:t.voice||_a.getVoice("0"),color:t.color||Rd()})}getSpeakers(){return this.speakers}addSpeaker(t,n){this.speakers.push({id:Mu(),name:t,voice:n,color:Rd()})}updateSpeaker(t,n){const r=this.speakers.findIndex(o=>o.id===t);r!==-1&&(this.speakers[r]={...this.speakers[r],...n})}getSpeakerById(t){return this.speakers.find(n=>n.id===t)||this.speakers[0]}}const En=new qD,eI=ae.div` background-color: ${e=>e.backgroundColor}; color: ${we.black}; border-radius: 5px;