@imgly/plugin-autocaption-web 1.75.0-rc.0 → 1.75.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/fal-ai/index.mjs +1 -1
- package/dist/fal-ai/index.mjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/fal-ai/index.mjs
CHANGED
|
@@ -7,5 +7,5 @@ ${d} --> ${a}
|
|
|
7
7
|
${o.text}`}).join(`
|
|
8
8
|
|
|
9
9
|
`)}function mr(n,e,t){let r=[],i=[],s=[],o="",c=()=>{i.length!==0&&(o.length>0&&s.push(o),r.push({start:i[0].start,end:i[i.length-1].end,text:s.join(`
|
|
10
|
-
`)}),i=[],s=[],o="")};for(let u of n){let d=o.length===0?u.text:`${o} ${u.text}`;d.length>e&&o.length>0?(s.push(o),o="",s.length>=t?(c(),o=u.text,i=[u]):(o=u.text,i.push(u))):(o=d,i.push(u))}return c(),r}function At(n){let e=Math.round(n*1e3),t=e%1e3,r=Math.floor(e/1e3),i=r%60,s=Math.floor(r/60),o=s%60;return`${Math.floor(s/60).toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")},${t.toString().padStart(3,"0")}`}var sr=yr(ir());function or(n,e){return(0,sr.createFalClient)({proxyUrl:n,requestMiddleware:async r=>({...r,headers:{...r.headers,...e??{}}})})}var ar="fal-ai/elevenlabs/speech-to-text/scribe-v2";function no(n){let e=or(n.proxyUrl,n.headers);return{name:"ElevenLabs Scribe V2",async transcribe(t,r){let i=r?.debug?console.log.bind(console):()=>{};i(`[ElevenLabsScribeV2] Uploading ${t.size} byte blob to fal storage...`);let s=new File([t],"audio.m4a",{type:t.type}),o=await e.storage.upload(s);i(`[ElevenLabsScribeV2] Upload complete: ${o}`),r?.abortSignal?.throwIfAborted();let c={audio_url:o
|
|
10
|
+
`)}),i=[],s=[],o="")};for(let u of n){let d=o.length===0?u.text:`${o} ${u.text}`;d.length>e&&o.length>0?(s.push(o),o="",s.length>=t?(c(),o=u.text,i=[u]):(o=u.text,i.push(u))):(o=d,i.push(u))}return c(),r}function At(n){let e=Math.round(n*1e3),t=e%1e3,r=Math.floor(e/1e3),i=r%60,s=Math.floor(r/60),o=s%60;return`${Math.floor(s/60).toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")},${t.toString().padStart(3,"0")}`}var sr=yr(ir());function or(n,e){return(0,sr.createFalClient)({proxyUrl:n,requestMiddleware:async r=>({...r,headers:{...r.headers,...e??{}}})})}var ar="fal-ai/elevenlabs/speech-to-text/scribe-v2";function no(n){let e=or(n.proxyUrl,n.headers);return{name:"ElevenLabs Scribe V2",async transcribe(t,r){let i=r?.debug?console.log.bind(console):()=>{};i(`[ElevenLabsScribeV2] Uploading ${t.size} byte blob to fal storage...`);let s=new File([t],"audio.m4a",{type:t.type}),o=await e.storage.upload(s);i(`[ElevenLabsScribeV2] Upload complete: ${o}`),r?.abortSignal?.throwIfAborted();let c={audio_url:o,...r?.language?{language_code:r.language}:{}};i(`[ElevenLabsScribeV2] Running ${ar} (language_code=${r?.language??"auto"})`);let d=(await e.run(ar,{input:c,abortSignal:r?.abortSignal})).data,a=d.words.filter(f=>f.type==="word").length;i(`[ElevenLabsScribeV2] Received ${a} words, detected language: ${d.language_code} (confidence: ${d.language_probability.toFixed(2)})`);let l=d.words.map(f=>({text:f.text,start:f.start,end:f.end,type:f.type})),y=Rt(l,{maxLineLength:r?.maxLineLength,maxLines:r?.maxLines});return i(`[ElevenLabsScribeV2] Generated SRT (${y.length} chars)`),{srt:y}}}}export{no as ElevenLabsScribeV2};
|
|
11
11
|
//# sourceMappingURL=index.mjs.map
|