import{_ as w,o as d,f as k,w as p,r as v,a as e,g as y,n as b,Q as h,R as f,t as a,S,c as _,i as V,F as $,h as l}from"./1.10.0_index.js";const j={data(){return{synth:null,voice:"",rate:1,pitch:1,song:null,voices:[]}},methods:{cancel(){console.log("cancel?"),this.synth.cancel()},say(){this.synth=window.speechSynthesis;const t=["Greetings, you are most sincerely invited to browse around."].join(`
`);let n=new SpeechSynthesisUtterance(t);n.voice=this.voice,n.pitch=this.pitch,n.rate=this.rate,this.song=n;const c=this.synth.speak(n);console.log(c)}},mounted(){const t=window.speechSynthesis;document.querySelector("form"),document.querySelector(".txt"),this.$refs.voice_select;let n=t.getVoices();n=n.filter(s=>s.lang.includes("en")),n.sort((s,m)=>{try{const r=s.name.split("+"),u=m.name.split("+");return r[1]>u[1]}catch{}return!0});const c=1e4;let g=1;this.voices=[];for(let s of n)if(this.voices.push({voice:s,name:s.name,lang:s.lang}),g++>=c){this.voice=s;break}}},C=j,B={style:{padding:".5in"}},U=e("h1",null,"Speech synthesizer",-1),N=e("p",null," Enter some text in the input below and press return to hear it. change voices using the dropdown menu. ",-1),q=e("input",{type:"text",class:"txt"},null,-1),z=e("label",{for:"rate"},"rate",-1),D=e("label",{for:"pitch"},"Pitch",-1),E=["value"],F=e("div",{style:{height:"10px"}},null,-1),M=e("p",{style:{whiteSpace:"pre-wrap"}},[l(" priorities"),e("br"),e("br"),l(" cycling through components"),e("br"),l(" tab & shift tab"),e("br"),e("br"),l(" cycling through regions"),e("br"),l(" r & shift r"),e("br"),e("br"),l(" step into a component"),e("br"),e("br"),l(" step out of a component"),e("br")],-1),T=e("p",null," n to jump between navigation elements ",-1),G=e("p",null," l to jump between regions ",-1),L=e("p",null,null,-1);function P(t,n,c,g,s,m){const r=v("s_panel"),u=v("lounge");return d(),k(u,null,{default:p(({palette:i,terrain:Q})=>[e("section",B,[y(r,null,{default:p(()=>[e("div",{style:b({padding:".2in",background:i[1],color:i[2],transition:["background "+i.change_duration,"color "+i.change_duration].join(", ")})},[U,N,q,e("div",null,[z,h(e("input",{type:"range",min:"0.5",max:"2",step:"0.1","onUpdate:modelValue":n[0]||(n[0]=o=>t.rate=o)},null,512),[[f,t.rate]]),e("div",null,a(t.rate),1)]),e("div",null,[D,h(e("input",{type:"range",min:"0",max:"2",step:"0.1","onUpdate:modelValue":n[1]||(n[1]=o=>t.pitch=o)},null,512),[[f,t.pitch]]),e("div",null,a(t.pitch),1)]),h(e("select",{ref:"voice_select","onUpdate:modelValue":n[2]||(n[2]=o=>t.voice=o)},[(d(!0),_($,null,V(t.voices,o=>(d(),_("option",{value:o.voice},a(o.name)+" "+a(o.lang),9,E))),256))],512),[[S,t.voice]]),e("div",null,"voice: "+a(t.voice.name),1),e("button",{onClick:n[3]||(n[3]=(...o)=>t.say&&t.say(...o))},"say"),e("button",{onClick:n[4]||(n[4]=(...o)=>t.cancel&&t.cancel(...o))},"cancel"),e("button",{onClick:n[5]||(n[5]=(...o)=>t.resume&&t.resume(...o))},"resume")],4)]),_:2},1024),F,y(r,{style:b({padding:".2in",background:i[1],color:i[2],transition:["background "+i.change_duration,"color "+i.change_duration].join(", ")})},{default:p(()=>[M,T,G,L]),_:2},1032,["style"])])]),_:1})}const A=w(C,[["render",P]]);export{A as default};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 13680 characters]
