PageSourceSearch

https://ffoz.org/_next/static/chunks/pages/internal/test/tts-9f724668533daecf.js

js ffoz.org collected 2026-10-02 07:31:11 UTC 9,354 bytes, 58 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5916],{18972:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>d});var n=t(37876),i=t(6724),r=t(59644),s=t(99431),o=t(94513),l=t(84597);function d(){return(0,n.jsx)(r.A,{fluid:!0,className:"p-10",children:(0,n.jsx)(s.A,{children:(0,n.jsxs)(o.A,{children:[(0,n.jsx)("h1",{className:"mb-4",children:"Text-to-Speech Test"}),(0,n.jsx)(l.A,{text:"This is a test of the Elven Labs text-to-speech functionality.",className:"mb-4"}),(0,n.jsx)("p",{children:"This page tests the integration of the Elven Labs TTS API with a custom audio player."})]})})})}d.getLayout=i.Gz},41874:(e,a,t)=>{"use strict";t.d(a,{A:()=>f});var n=t(37876),i=t(69609),r=t.n(i),s=t(83413);t(25937);var o=t(16525),l=t(40944),d=t(89582),p=t(14232),c=t(99054),x=t(97460),m=t(52276),h=t(44517),u=t(73384),g=t(29064);function f({audio:e,player:a,num:t,small:i,tts:b,playControl:w,speedControl:y,setPlaying:_=()=>{},playing:j,speed:v,slug:k}){let[A,N]=(0,p.useState)(15e3),{view:E,isMobile:L,setSaveSession:T,isOpenSubmenu:C}=(0,l.QN)(),{isVisibleSearch:S}=(0,g.$A)();(0,p.useEffect)(()=>{(S||C)&&a.current.audio.current.pause()},[S,C]);let z=`
2  ${i&&`
3      @media only screen and (min-width: 991px) and (max-width: 1400px) 
4      {
5    //    .rhap_main  {
6    //      display: flex;
7    //      flex-direction: column;
8    //      width: 100%;
9    //      }
10         .rhap_volume-controls {
11    //       margin-left: -50px;
12    //       padding-right: 18px;
13         }
14        .rhap_controls-section {
15    //      margin-top: 10px;
16          display: flex;
17          justify-content: space-between;
18          align-items: center;
19          width: 100%;
20        }
21      }
22    `}
23`,R=`
24  ${b&&`
25    @media only screen and (min-width: 1px) 
26    {
27      .rhap_main  {
28        display: flex;
29        flex-direction: row-reverse;
30        width: 100%;
31        }
32       .rhap_volume-controls {
33         margin-left: 0;
34         padding-right: 18px;
35       }
36      .rhap_controls-section {
37        margin-top: 0;
38        display: flex;
39        justify-content: space-between;
40        align-items: center;
41        width: 100%;
42      }
43      .rhap_container {
44        padding: 10px 10px 10px 20px !important;
45        background-color:rgba(238, 241, 246, 1);  
46      }
47      .rhap_main-controls {
48        margin-right: 0
49      }
50    }
51    @media only screen and (max-width: 991px) {
52      .rhap_volume-controls {
53        display: none!important;
54      }
55  }  
56  `}
57`,I=(0,n.jsx)(o.A,{style:{borderRadius:"5px",borderColor:"white"},children:(0,n.jsxs)(o.A.Body,{style:{width:"250px",boxShadow:"0 0 8px rgba(0, 0, 0, 0.15)",padding:"15px"},children:[(0,n.jsx)(d.A.Range,{defaultValue:A,onChange:e=>N(e.target.value),min:"5000",max:"60000",step:"5000"}),(0,n.jsxs)(d.A.Label,{className:"d-flex justify-content-between",children:[(0,n.jsx)("span",{className:"fw-bold",children:"Seek"}),(0,n.jsxs)("span",{className:"ps-3 text-lowercase fw-bold",children:[A/1e3,(0,n.jsx)("span",{children:"s"})]})]}),(0,n.jsx)("hr",{}),(0,n.jsx)("div",{className:"d-flex",children:(0,n.jsx)(d.A.Range,{defaultValue:v,onChange:e=>y(t,e.target.value),min:"0.5",max:"2",step:"0.5"})}),(0,n.jsxs)(d.A.Label,{className:"d-flex justify-content-between",children:[(0,n.jsx)("span",{className:"fw-bold",children:"Speed"}),(0,n.jsxs)("span",{className:"ps-3 fw-bold",children:[v,(0,n.jsx)("span",{children:"x"})]})]})]})});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.A,{autoPlay:!1,layout:"horizontal-reverse",src:e||void 0,showDownloadProgress:!1,onListen:()=>{k&&((0,u.S)("audio",k,a?.current?.audio?.current?.currentTime),T(!0))},progressJumpSteps:{forward:A,backward:A},ref:a,customAdditionalControls:[],defaultCurrentTime:"00:00",defaultDuration:"00:00",listenInterval:2e3,onLoadedData:()=>{if(k){let e=(0,u.l)("audio",k);e&&(a.current.audio.current.currentTime=e)}},timeFormat:"mm:ss",customVolumeControls:[s.n.VOLUME,L&&(0,n.jsx)(x.g,{icon:m.AI,color:"black",size:"sm",className:"ps-3"})],customProgressBarSection:[s.n.CURRENT_TIME,s.n.PROGRESS_BAR,s.n.DURATION,(0,n.jsx)(c.A,{rootClose:!0,trigger:"click",placement:"left",overlay:I,children:(0,n.jsx)(x.g,{icon:h.nx5,color:"black",style:E.width>991?{cursor:"pointer",padding:"0 15px"}:E.width<991&&E.width>760?{position:"relative",right:"25px",top:"50px",padding:"0 7px",cursor:"pointer"}:E.width<760&&E.width>
57520||E.width<520?{position:"relative",right:"25px",padding:"0 7px",top:"50px"}:{}})})],customIcons:{play:(0,n.jsx)(x.g,{icon:m.ijD,color:"black",size:"sm",width:b?"18":void 0,onClick:()=>w(t)&&_(!j)}),pause:(0,n.jsx)(x.g,{icon:m.G1Y,color:"black",size:"sm",width:b?"18":void 0,onClick:()=>_(!j)}),rewind:(0,n.jsx)(x.g,{icon:h.ub2,color:"black",size:"2xs",width:b?"16":void 0}),forward:(0,n.jsx)(x.g,{icon:h.lLb,color:"black",size:"2xs",width:b?"16":void 0}),volumeMute:(0,n.jsx)(x.g,{icon:m.VnB,color:"black",size:"2xs"}),volume:L?(0,n.jsx)(x.g,{icon:m.gNA,color:"black",size:"2xs"}):(0,n.jsx)(x.g,{icon:m.eFC,color:"black",size:"2xs"})}}),(0,n.jsx)(r(),{id:"b5c34d58ed8da8de",dynamic:[R,z],children:`${R} input[type="range"]::-webkit-slider-thumb{background:#007fad}input[type="range"]::-webkit-slider-thumb:active{background:#007fad}input[type="range"]::-moz-range-thumb{background:#007fad}input[type="range"]::-moz-range-thumb:active{background:#007fad}input[type="range"]::-ms-thumb{background:#007fad}.rhap_container{box-shadow:none;border-radius:.5rem}@media only screen and (min-width:991px){.rhap_container{padding:15px 25px 15px 25px}}@media only screen and (max-width:991px){.rhap_container{padding:15px}}@media only screen and (max-width:991px){.rhap_main{padding-top:10px;display:flex;flex-direction:column}}.rhap_controls-section{display:flex;flex:1}@media only screen and (max-width:991px){.rhap_controls-section{flex-direction:column;padding-top:20px}}.rhap_main-controls{display:flex;flex:1;padding-right:25px}@media only screen and (max-width:991px){.rhap_main-controls{padding-right:0px;padding-bottom:15px}}.rhap_progress-container{min-width:120px}.rhap_progress-bar{background-color:rgba(0,81,133,.2);height:6px;background-color:#ddd;border-radius:3px}.rhap_progress-filled{border-radius:3px}.rhap_progress-filled{background-color:#005185;opacity:1}.rhap_progress-indicator{background-color:#005185;opacity:1}.rhap_time{color:black;font-size:.8125rem;letter-spacing:.05em;font-weight:500}@media only screen and (max-width:991px){.rhap_time{font-size:.75rem;letter-spacing:.05em}}.rhap_total-time{margin-right:0px;margin-left:10px}@media only screen and (max-width:991px){.rhap_total-time{margin-right:0;margin-left:10px}}@media only screen and (max-width:520px){.rhap_total-time{margin-left:0px;margin-right:0px}}.rhap_current-time{width:50px;margin-left:16px}@media only screen and (max-width:991px){.rhap_current-time{margin-left:10px;width:40px}}.rhap_volume-controls{padding-right:25px}@media only screen and (max-width:991px){.rhap_volume-controls{padding-right:0px;margin-bottom:8px;display:none}}.rhap_volume-button{color:black}.rhap_volume-bar{width:90px}@media only screen and (max-width:991px){.rhap_volume-bar{width:200px;display:none}}.rhap_volume-indicator{background-color:black;opacity:1}${z}
58        `})]})}},49156:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/internal/test/tts",function(){return t(18972)}])},73384:(e,a,t)=>{"use strict";t.d(a,{S:()=>r,l:()=>i});var n=t(76248);let i=(e,a)=>{let t=(0,n.oi)("timestamp"),i=t&&t.find(t=>t.asset===e&&t.slug===a);return i?i.timestamp:null},r=(e,a,t)=>{let i=(0,n.oi)("timestamp")||[],r=i.findIndex(t=>t.asset===e&&t.slug===a),s=r>-1?i[r].timestamp:null;(s?Math.abs(t-s):1/0)<1||(r>-1?i[r]={asset:e,slug:a,timestamp:t}:(i.length>30&&i.shift(),i.push({asset:e,slug:a,timestamp:t})),(0,n.UD)("timestamp",i))}},84597:(e,a,t)=>{"use strict";t.d(a,{A:()=>x});var n=t(37876),i=t(14232),r=t(97460),s=t(52276),o=t(40944),l=t(41874),d=t(91040);async function p({text:e,voiceId:a,apiKey:t}){let n=`https://api.elevenlabs.io/v1/text-to-speech/${a}`,i=await d.A.post(n,{text:e,model_id:"eleven_monolingual_v2",voice_settings:{stability:.5,similarity_boost:.5}},{headers:{"xi-api-key":t,"Content-Type":"application/json",Accept:"audio/mpeg"},responseType:"blob"});return URL.createObjectURL(i.data)}var c=t(65364);function x({text:e="No text was passed.",className:a=""}){let[t,d]=(0,i.useState)(null),[m,h]=(0,i.useState)(!1),[u,g]=(0,i.useState)(null),[f,b]=(0,i.useState)(!1),w=(0,i.useRef)(null),{url:y}=(0,o.QN)(),_=c.env.NEXT_PUBLIC_ELVENLABS_API_KEY||"",j=c.env.NEXT_PUBLIC_ELVENLABS_VOICE_ID||"21m00Tcm4TlvDq8ikWAM";(0,i.useEffect)(()=>{d(null),b(!1),g(null)},[y,e]);let v=async()=>
58{if(t||m)t&&w.current&&(f?(w.current.audio.current.pause(),b(!1)):(w.current.audio.current.play(),b(!0)));else{h(!0),g(null);try{let a=await p({text:e,voiceId:j,apiKey:_});d(a),b(!0)}catch(e){g("Failed to generate audio.")}finally{h(!1)}}};return(0,i.useEffect)(()=>()=>{t&&URL.revokeObjectURL(t)},[t]),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:a,children:[(0,n.jsx)("a",{onClick:v,className:"link large",style:{cursor:"pointer"},children:(0,n.jsx)(r.g,{icon:f?s.G1Y:s.ijD,spin:m})}),u&&(0,n.jsx)("span",{style:{color:"red",marginLeft:8},children:u})]}),t&&(0,n.jsx)(l.A,{audio:t,player:w,playControl:()=>b(e=>!e),setPlaying:b,playing:f,speed:1})]})}}},e=>{e.O(0,[7741,636,6593,8792],()=>e(e.s=49156)),_N_E=e.O()}]);

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.