bellows-voice 0.6.2 → 0.7.0
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/README.md +10 -1
- package/THIRD_PARTY_NOTICES.md +44 -0
- package/dist/chunk-WA623NKS.js +6 -0
- package/dist/chunk-WA623NKS.js.map +7 -0
- package/dist/dict/cmudict-data.gen.d.ts +4 -0
- package/dist/dict/cmudict-data.gen.d.ts.map +1 -0
- package/dist/dict/cmudict.d.ts +6 -0
- package/dist/dict/cmudict.d.ts.map +1 -0
- package/dist/dict/phones.d.ts +5 -0
- package/dist/dict/phones.d.ts.map +1 -0
- package/dist/dict.d.ts +2 -0
- package/dist/dict.d.ts.map +1 -0
- package/dist/dict.js +100559 -0
- package/dist/dict.js.map +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lyrics/numbers.d.ts +11 -0
- package/dist/lyrics/numbers.d.ts.map +1 -0
- package/dist/lyrics/read.d.ts +2 -0
- package/dist/lyrics/read.d.ts.map +1 -1
- package/dist/lyrics/speech.d.ts.map +1 -1
- package/dist/text.d.ts +1 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -183,7 +183,16 @@ registerVoice();
|
|
|
183
183
|
|
|
184
184
|
## Pronunciations
|
|
185
185
|
|
|
186
|
-
Words go through English letter-to-sound rules
|
|
186
|
+
Words go through English letter-to-sound rules (about 77 percent of common words exact) unless you give
|
|
187
|
+
a pronouncing dictionary. One ships as its own entry, loaded only if you import it (about 590 KB gzipped):
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
import { cmudict } from 'bellows-voice/dict';
|
|
191
|
+
const v = singer(b, 'narrator-female', { dictionary: cmudict() }); // every CMU word as CMU says it
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Numbers, symbols and initialisms are said as words ("21st", "$5", "10:05", "TV"). IPA between slashes,
|
|
195
|
+
`/ˈlɪt.əl/`, sets the sounds directly.
|
|
187
196
|
|
|
188
197
|
## Content-Security-Policy
|
|
189
198
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -132,3 +132,47 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
132
132
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
133
133
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
134
134
|
SOFTWARE.
|
|
135
|
+
|
|
136
|
+
## The CMU Pronouncing Dictionary
|
|
137
|
+
|
|
138
|
+
`src/dict/cmudict-data.gen.ts` (shipped in `dist/dict.js`, the `bellows-voice/dict` entry) is generated
|
|
139
|
+
by `scripts/gen-dict.mjs` from the Carnegie Mellon University Pronouncing Dictionary
|
|
140
|
+
(`data/cmudict/cmudict.txt.gz`, the copy CHIMERA ships), keeping the words the English reader gets
|
|
141
|
+
wrong without it, re-encoded. Its notice:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Copyright (C) 1993-2015 Carnegie Mellon University. All rights reserved.
|
|
145
|
+
|
|
146
|
+
Redistribution and use in source and binary forms, with or without
|
|
147
|
+
modification, are permitted provided that the following conditions
|
|
148
|
+
are met:
|
|
149
|
+
|
|
150
|
+
1. Redistributions of source code must retain the above copyright
|
|
151
|
+
notice, this list of conditions and the following disclaimer.
|
|
152
|
+
The contents of this file are deemed to be source code.
|
|
153
|
+
|
|
154
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
155
|
+
notice, this list of conditions and the following disclaimer in
|
|
156
|
+
the documentation and/or other materials provided with the
|
|
157
|
+
distribution.
|
|
158
|
+
|
|
159
|
+
This work was supported in part by funding from the Defense Advanced
|
|
160
|
+
Research Projects Agency, the Office of Naval Research and the National
|
|
161
|
+
Science Foundation of the United States of America, and by member
|
|
162
|
+
companies of the Carnegie Mellon Sphinx Speech Consortium. We acknowledge
|
|
163
|
+
the contributions of many volunteers to the expansion and improvement of
|
|
164
|
+
this dictionary.
|
|
165
|
+
|
|
166
|
+
THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
|
|
167
|
+
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
168
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
169
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
|
|
170
|
+
NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
171
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
172
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
173
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
174
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
175
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
176
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
177
|
+
```
|
|
178
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*! bellows-voice | MIT, Copyright (c) 2026 Moheeb Zara | includes code from CHIMERA, https://github.com/jamesondh/chimera-vocal-synth, Copyright (c) 2026 Jameson Hodge, MIT License | notices in THIRD_PARTY_NOTICES.md */
|
|
2
|
+
import{g as y,j as pe,m as fe,u as z}from"./chunk-MCZRKZS7.js";var Ee="iy\u0268\u0289\u026Fu\u026A\u028F\u028Ae\xF8\u0258\u0275\u0264o\u0259\u025B\u0153\u025C\u025E\u028C\u0254\xE6\u0250a\u0276\u0251\u0252\u025D\u025A",yt="pbtd\u0288\u0256c\u025Fkgq\u0262\u0294m\u0271n\u0273\u0272\u014B\u0274\u0278\u03B2fv\u03B8\xF0sz\u0283\u0292\u0282\u0290\xE7\u029Dx\u0263\u03C7\u0281\u0127\u0295h\u0266\u026C\u026E\u0255\u0291w\u028B\u0279\u027Bj\u0265\u0270l\u026B\u026D\u028E\u027E\u027Dr\u0280\u0299",me=["t\u0283","d\u0292","a\u026A","a\u028A","\u0254\u026A","e\u026A","o\u028A"],Nt=new Map([["\u0261","g"],["\u02A7","t\u0283"],["\u02A4","d\u0292"],["\u03B5","\u025B"],["\u03B1","\u0251"],["\u1D7B","\u026A"],["\u1D7F","\u028A"],["\u0269","\u026A"],["\u0277","\u028A"],["\u02A6","ts"],["\u02A3","dz"],["\u02A8","t\u0255"],["\u02A5","d\u0291"]]),wt=/^(?=[\p{Ll}\p{Lo}])[\p{Script=Latin}\p{Script=Greek}]$/u,It=new Set(Array.from(Ee)),Y=new Set([...Ee,...yt,...me]),N="_",Lt=.16,Ut=.15,xt=.09,Pt=1.7,vt="\u0329",Ft="\u030D",Dt=/[\u035C\u0361]/g,P=0,V=1,v=2;function f(e){let t=e.codePointAt(0);return t!==void 0&&It.has(String.fromCodePoint(t))}function Mt(e){return j(e).segments}function j(e){let t=Array.from(kt(e)),r=[],n=[],o=0,a=0;for(;a<t.length;){let i=t[a];if(i==="\u02C8"||i==="'"){o=1,a++;continue}if(i==="\u02CC"){o=2,a++;continue}if(i==="."){W(n,V),a++;continue}if(i===","||i==="|"||i==="\u2016"){W(n,v),r.push({ipa:N,dur:Lt}),n.push(P),a++;continue}if(/\s/.test(i)){W(n,v),a++;continue}if(i==="\u02D0"||i===":"){let c=r[r.length-1];if(c){let u=f(c.ipa)?Ut:xt;c.dur=(c.dur??u)*Pt}a++;continue}let s=i;for(let c of me)Bt(t,a,c)&&(s=c);a+=s===i?1:Array.from(s).length;let l=!1;for(;a<t.length&&Gt(t[a]);)(t[a]===vt||t[a]===Ft)&&(l=!0),a++;if(!(!Y.has(s)&&!wt.test(s))){if(f(s)){r.push({ipa:s,stress:o}),n.push(P),o=0;continue}l&&(r.push({ipa:"\u0259",stress:o}),n.push(P),o=0),r.push({ipa:s}),n.push(P)}}return{segments:r,breaks:n}}function W(e,t){let r=e.length-1;r>=0&&e[r]<t&&(e[r]=t)}function Bt(e,t,r){let n=t;for(let o of r){if(e[n]!==o)return!1;n++}return!0}function Gt(e){return e>="\u0300"&&e<="\u036F"}function kt(e){let t="";for(let r of e.normalize("NFC")){if(Y.has(r)){t+=r;continue}let n=Nt.get(r);if(n!==void 0){t+=n;continue}let o=Array.from(r.normalize("NFD"));if(o.length>1){let a=(o[0]+o[1]).normalize("NFC");if(Y.has(a)){t+=a+o.slice(2).join("");continue}}t+=o.join("")}return t.replace(Dt,"")}var _t=new Map([["AA","\u0251"],["AE","\xE6"],["AH","\u028C"],["AO","\u0254"],["AW","a\u028A"],["AY","a\u026A"],["EH","\u025B"],["ER","\u025D"],["EY","e\u026A"],["IH","\u026A"],["IY","i"],["OW","o\u028A"],["OY","\u0254\u026A"],["UH","\u028A"],["UW","u"],["B","b"],["CH","t\u0283"],["D","d"],["DH","\xF0"],["F","f"],["G","g"],["HH","h"],["JH","d\u0292"],["K","k"],["L","l"],["M","m"],["N","n"],["NG","\u014B"],["P","p"],["R","\u0279"],["S","s"],["SH","\u0283"],["T","t"],["TH","\u03B8"],["V","v"],["W","w"],["Y","j"],["Z","z"],["ZH","\u0292"]]),zt=/^([A-Z]+)([012])?$/;function K(e){let t=[];for(let r of e.trim().split(/\s+/)){let n=zt.exec(r);if(!n)continue;let o=n[1],a=n[2]==="1"?1:n[2]==="2"?2:0,i=_t.get(o);i!==void 0&&(a===0&&o==="AH"&&(i="\u0259"),a===0&&o==="ER"&&(i="\u025A"),t.push(f(i)?{ipa:i,stress:a}:{ipa:i}))}return t}var $=[["#C","ed","#","\u025B d"],["#CC","ed","#","\u025B d"],["#CCC","ed","#","\u025B d"],["#C","es","#","\u025B s"],["#CC","es","#","\u025B s"],["#y","es","#","\u025B s"],["t","ed","#","\u026A d"],["d","ed","#","\u026A d"],["k","ed","#","t"],["p","ed","#","t"],["s","ed","#","t"],["f","ed","#","t"],["x","ed","#","t"],["h","ed","#","t"],["c","ed","#","t"],["s","es","#","\u026A z"],["z","es","#","\u026A z"],["x","es","#","\u026A z"],["h","es","#","\u026A z"],["c","es","#","\u026A z"],["g","es","#","\u026A z"],["r","s","#","z"],["l","s","#","z"],["m","s","#","z"],["n","s","#","z"],["d","s","#","z"],["g","s","#","z"],["b","s","#","z"],["v","s","#","z"],["w","s","#","z"],["u","s","#","s"],["","ng","s#","\u014B"],["","ng","ing","\u014B"],["","ng","ly","\u014B"],["","ng","ed#","\u014B"],["","n","k","\u014B"],["","iew","","j u"],["f","ew","","j u"],["p","ew","","j u"],["m","ew","","j u"],["h","ew","","j u"],["","ew","","u"],["","cious","","\u0283 \u0259 s"],["","tious","","\u0283 \u0259 s"],["","ous","#","\u0259 s"],["#h","ow","","a\u028A"],["#n","ow","","a\u028A"],["#c","ow","","a\u028A"],["#w","ow","","a\u028A"],["#v","ow","","a\u028A"],["#all","ow","","a\u028A"],["","ow","s#","o\u028A"],["","ow","ing","o\u028A"],["","ow","ly","o\u028A"],["","ow","ed#","o\u028A"],["#","ow","n","o\u028A"],["l","ow","n","o\u028A"],["h","ow","n","o\u028A"],["n","ow","n","o\u028A"],["gr","ow","n","o\u028A"],["thr","ow","n","o\u028A"],["","o","#","o\u028A"],["","o","ld","o\u028A"],["","o","lt","o\u028A"],["","i","nd#","a\u026A"],["","i","nds#","a\u026A"],["","i","nding","a\u026A"],["","i","ndly","a\u026A"],["","i","ndness","a\u026A"],["","i","ld#","a\u026A"],["","i","ldly","a\u026A"],["","all","#","\u0254 l"],["","all","s#","\u0254 l"],["","all","ing","\u0254 l"],["","all","ed#","\u0254 l"],["","alk","","\u0254 k"],["w","ar","","\u0254 \u0279"],["w","a","CC","\u0251"],["w","a","C#","\u0251"],["","ea","d#","\u025B"],["","ea","dy","\u025B"],["","ea","lth","\u025B"],["","ea","th#","\u025B"],["","ea","ther","\u025B"],["","ea","vy","\u025B"],["","ea","ven","\u025B"],["","ea","sant","\u025B"],["","ea","sure","\u025B"],["","ea","dow","\u025B"],["","oo","k","\u028A"],["g","oo","d","\u028A"],["w","oo","d","\u028A"],["h","oo","d","\u028A"],["t","oo","d","\u028A"],["f","oo","t","\u028A"],["d","oo","r","\u0254"],["fl","oo","r","\u0254"],["l","o","ve","\u028C"],["l","o","vi","\u028C"],["b","o","ve#","\u028C"],["c","o","ver","\u028C"],["s","o","me","\u028C"],["c","o","me","\u028C"],["w","o","n","\u028C"],["","o","ney","\u028C"],["","o","nth","\u028C"],["","o","ther","\u028C"],["","o","thing","\u028C"],["","th","er","\xF0"],["","th","e#","\xF0"],["","ear","l","\u025D"],["","ear","n","\u025D"],["","ear","ch","\u025D"],["","ear","th","\u025D"],["h","ear","d#","\u025D"],["h","ear","t","\u0251 \u0279"],["C","are","#","\u025B \u0279"],["","a","rr","\xE6"],["C","a","rV","\u025B"],["","i","re#","a\u026A"],["V","sure","","\u0292 \u025A"],["#","s","ure","\u0283"],["","ure","#","\u028A \u0279"],["","i","ty#","\u026A"],["t","i","ve#","\u026A"],["C","i","ly#","\u0259"],["","i","ver","\u026A"],["","i","ven","\u026A"],["#","a","Ce#","e\u026A"],["#","a","wa","\u0259"],["#","a","CV","\u0259"],["#","u","CV","j u"],["m","u","CV","j u"],["f","u","CV","j u"],["p","u","CV","j u"],["b","u","CV","j u"],["c","u","CV","j u"],["h","u","CV","j u"],["","ough","t","\u0254"],["","ou","l","o\u028A"],["","ou","ng","\u028C"],["","ou","ble","\u028C"],["","ou","ntry","\u028C"],["f","our","","\u0254 \u0279"],["p","our","","\u0254 \u0279"],["c","our","","\u0254 \u0279"],["s","our","","\u0254 \u0279"],["#","g","i","g"],["w","or","n","\u0254 \u0279"],["w","or","C","\u025D"],["","er","r","\u025B"],["VC","er","y#","\u025A"],["VC","or","y#","\u025A"],["VC","or","ies#","\u025A"],["","a","nge#","e\u026A"],["","a","nges#","e\u026A"],["","a","nged#","e\u026A"],["","a","ngel","e\u026A"],["","n","ge#","n"],["","n","ges#","n"],["","n","ged#","n"],["","n","gel","n"],["m","n","#",""],["#gu","y","#","a\u026A"],["#","gu","V","g"],["","eau","t","j u"],["#","al","so","\u0254 l"],["#","al","w","\u0254 l"],["#","al","r","\u0254 l"],["#","al","mo","\u0254 l"],["#","al","th","\u0254 l"],["Co","s","e#","z"],["Ci","s","e#","z"],["au","s","e#","z"],["ai","s","e#","z"],["oi","s","e#","z"],["ea","s","on","z"],["#h","ere","#","\u026A \u0279"],["h","ere","#","\u025B \u0279"],["","ere","#","\u026A \u0279"],["m","o","st","o\u028A"],["p","o","st","o\u028A"],["h","o","st","o\u028A"],["#","o","nly","o\u028A"],["VC","e","ly#",""],["VC","e","ful",""],["VC","e","ness",""],["VC","e","ment",""],["VC","e","less",""],["w","a","ter","\u0254"],["f","a","ther","\u0251"],["","a","Cow","\xE6"],["","i","Cow","\u026A"],["","i","rV","\u026A"],["#f","or","ev","\u025A"],["#f","or","g","\u025A"],["#","o","h#","o\u028A"],["V","h","#",""],["","aa","","\u0251"],["#y","e","#","i"],["#h","ey","#","e\u026A"],["","eah","#","\xE6"],["","tion","","\u0283 \u0259 n"],["","sion","","\u0292 \u0259 n"],["","ture","","t\u0283 \u025A"],["","ough","#","o\u028A"],["","augh","","\u0254"],["","igh","","a\u026A"],["","eigh","","e\u026A"],["","tch","","t\u0283"],["","dge","","d\u0292"],["","sch","","s k"],["","ch","","t\u0283"],["","sh","","\u0283"],["","th","","\u03B8"],["","ph","","f"],["","wh","","w"],["","ck","","k"],["","ng","#","\u014B"],["","ng","","\u014B g"],["","qu","","k w"],["#","kn","","n"],["#","wr","","\u0279"],["","gh","",""],["","ee","","i"],["","ea","","i"],["","oo","","u"],["","ou","","a\u028A"],["","ow","#","o\u028A"],["","ow","","a\u028A"],["","oi","","\u0254\u026A"],["","oy","","\u0254\u026A"],["","ai","","e\u026A"],["","ay","","e\u026A"],["","au","","\u0254"],["","aw","","\u0254"],["","ie","#","a\u026A"],["","ie","","i"],["","ei","","e\u026A"],["","ey","#","i"],["","oa","","o\u028A"],["","ue","#","u"],["","er","#","\u025A"],["","er","C","\u025D"],["","ir","","\u025D"],["","ur","","\u025D"],["","or","","\u0254 \u0279"],["","ar","","\u0251 \u0279"],["C","le","#","\u0259 \u026B"],["","ed","#","d"],["","es","#","z"],["C","s","#","s"],["V","s","#","z"],["#C","y","#","a\u026A"],["#CC","y","#","a\u026A"],["#CCC","y","#","a\u026A"],["","y","#","i"],["#","y","","j"],["C","y","","a\u026A"],["#C","e","#","i"],["#CC","e","#","i"],["","e","#",""],["#C","a","#","\u0251"],["#CC","a","#","\u0251"],["","a","CV","e\u026A"],["","a","","\xE6"],["","e","","\u025B"],["","i","CV","a\u026A"],["","i","","\u026A"],["","o","CV","o\u028A"],["","o","","\u0251"],["","u","CV","u"],["","u","","\u028C"],["","y","","\u026A"],["","c","e","s"],["","c","i","s"],["","c","y","s"],["","c","","k"],["","g","e","d\u0292"],["","g","i","d\u0292"],["","g","","g"],["","x","","k s"],["","j","","d\u0292"],["","q","","k"],["","b","","b"],["","d","","d"],["","f","","f"],["","h","","h"],["","k","","k"],["","l","","l"],["","m","","m"],["","n","","n"],["","p","","p"],["","r","","\u0279"],["","s","","s"],["","t","","t"],["","v","","v"],["","w","","w"],["","z","","z"]],Wt=$.map(e=>e[3]?e[3].split(" "):[]);function Ae(e){let t=[],r=0;for(;r<e.length;){let a=!1;for(let i=0;i<$.length;i++){let[s,l,c]=$[i];if(e.startsWith(l,r)&&Te(e,r-1,s,-1)&&Te(e,r+l.length,c,1)){for(let u of Wt[i])!f(u)&&u===t[t.length-1]||t.push(u);r+=l.length,a=!0;break}}a||r++}let n=[],o=t.findIndex(a=>f(a)&&a!=="\u0259"&&a!=="\u025A");o<0&&(o=t.findIndex(a=>f(a)));for(let a=0;a<t.length;a++){let i=t[a];f(i)?n.push({ipa:i,stress:a===o?1:0}):n.push({ipa:i})}return n}function ge(e){return e==="a"||e==="e"||e==="i"||e==="o"||e==="u"||e==="y"}function Te(e,t,r,n){let o=t;for(let a=0;a<r.length;a++){let i=n===1?r[a]:r[r.length-1-a],s=o>=0&&o<e.length?e[o]:void 0;if(i==="#"){if(s!==void 0)return!1}else if(i==="V"){if(!ge(s))return!1}else if(i==="C"){if(s===void 0||ge(s))return!1}else if(s!==i)return!1;o+=n}return!0}var Yt=new Set(["p","b","t","d","k","g","f","v","\u03B8","\xF0","s","z","\u0283","\u0292","h","m","n","l","\u0279","w","j","t\u0283","d\u0292","pl","bl","kl","gl","fl","sl","p\u0279","b\u0279","t\u0279","d\u0279","k\u0279","g\u0279","f\u0279","\u03B8\u0279","\u0283\u0279","sp","st","sk","sm","sn","sw","sf","tw","kw","dw","gw","\u03B8w","pj","bj","kj","gj","mj","nj","fj","vj","hj","lj","spl","sp\u0279","st\u0279","sk\u0279","skw","skj","spj"]),Vt=new Map([["r","\u0279"],["\u026B","l"]]),jt=new Set(Array.from("m\u0271n\u0273\u0272\u014B\u0274l\u026B\u026D\u028E\u0279\u027Br\u0280\u0299\u027E\u027Djw\u028B\u0265\u0270")),Kt=new Set(Array.from("\u0278\u03B2fv\u03B8\xF0sz\u0283\u0292\u0282\u0290\xE7\u029Dx\u0263\u03C7\u0281\u0127\u0295h\u0266\u026C\u026E\u0255\u0291"));function Se(e){return jt.has(e)?2:Kt.has(e)?1:0}function D(e){if(e.length===0)return;let t=0;for(let r=1;r<e.length;r++)Se(e[r].ipa)>Se(e[t].ipa)&&(t=r);return{onset:e.slice(0,t),nucleus:e[t],coda:e.slice(t+1)}}var $t=3;function w(e){let t=[];for(let o=0;o<e.length;o++)f(e[o].ipa)&&t.push(o);let r=[],n=0;for(let o=0;o<t.length;o++){let a=t[o],i=e.length;if(o+1<t.length){let s=t[o+1],l=s-(a+1),c=0;for(let u=Math.min($t,l);u>=1;u--)if(Qt(e,s-u,s)){c=u;break}i=s-c}r.push({onset:e.slice(n,a),nucleus:e[a],coda:e.slice(a+1,i)}),n=i}return r}function Qt(e,t,r){if(r-t===1){let o=e[t].ipa;return o!=="\u014B"&&o!==N}let n="";for(let o=t;o<r;o++)n+=Vt.get(e[o].ipa)??e[o].ipa;return Yt.has(n)}var Zt=new Set(["th","sh","ch","ph","wh","ck","gh"]);function Re(e,t){let r=Math.floor(t);if(!(r>1)||!Number.isFinite(r))return[e];let n=Array.from(e),o=n.length,a=[];for(let h=0;h<o;){if(!F(n[h])){h++;continue}let E=h;do h++;while(h<o&&F(n[h])&&!qt(n[h]));a.push([E,h])}let i=o>=2&&(n[o-1]==="e"||n[o-1]==="E"),s=i&&!F(n[o-2]),l=i&&o>=3&&(n[o-2]==="l"||n[o-2]==="L")&&!F(n[o-3])&&n[o-3]!=="l"&&n[o-3]!=="L";if(a.length>1&&s&&!l&&a[a.length-1][0]+1===o&&a.pop(),a.length<r){let h=[e];for(let E=1;E<r;E++)h.push("~");return h}for(;a.length>r;){let h=a.pop();a[a.length-1][1]=h[1]}let c=[0];for(let h=0;h<a.length-1;h++){let E=a[h][1],d=a[h+1][0],p=d-E,m=p>=2&&Zt.has((n[d-2]+n[d-1]).toLowerCase());c.push(m?d-2:E+(p<=1?0:Math.floor(p/2)))}c.push(o);let u=[];for(let h=0;h<c.length-1;h++)u.push(n.slice(c[h],c[h+1]).join(""));return u}function F(e){switch(e.length===1&&e<"\x80"?e:e.normalize("NFD")[0]){case"a":case"e":case"i":case"o":case"u":case"y":case"A":case"E":case"I":case"O":case"U":case"Y":return!0;default:return!1}}function qt(e){return e.length===1&&e<"\xC0"?!1:e.normalize("NFD").includes("\u0308")}var Xt=["KIT","DRESS","TRAP","LOT","STRUT","FOOT","BATH","CLOTH","NURSE","FLEECE","FACE","PALM","THOUGHT","GOAT","GOOSE","PRICE","CHOICE","MOUTH","NEAR","SQUARE","START","NORTH","FORCE","CURE","happY","lettER","commA"],Jt=new Set(["dance","dancer","dancing","chance","glance","lance","prance","trance","france","advance","enhance","plant","grant","slant","chant","aunt","can't","shan't","branch","answer","example","sample","demand","command","commander","remand","rather","father","half","calf","laugh","laughter","banana","drama"]),en=new Set(["after","nasty","master","disaster","plaster","pastor","rafter","castle","fasten"]),tn=/au|aw|al[lkt]|ough|augh|oa|wa/;function Q(e,t){let r=e.toLowerCase(),n=[];for(let o=0;o<t.length;o++)f(t[o].ipa)&&n.push(o);for(let o=0;o<n.length;o++){let a=n[o],i=t[a],s=t[a+1]?.ipa,l=t[a+2]?.ipa,u=s==="\u0279"&&(l===void 0||!f(l)),h=i.stress!==void 0&&i.stress>0,E=o===n.length-1;i.set=nn(i.ipa,{w:r,next:s,after:l,rCoda:u,stressed:h,last:E,single:n.length===1})}}function nn(e,t){switch(e){case"i":return t.rCoda?"NEAR":!t.stressed&&t.last?"happY":"FLEECE";case"\u026A":return t.rCoda?"NEAR":"KIT";case"\u025B":return t.rCoda?"SQUARE":"DRESS";case"e\u026A":return t.rCoda?"SQUARE":"FACE";case"\xE6":return Jt.has(t.w)||en.has(t.w)||(t.next==="f"||t.next==="\u03B8"||t.next==="s")&&(t.after===void 0||!f(t.after))?"BATH":"TRAP";case"\u0251":return t.rCoda?"START":/(w|qu)a/.test(t.w)||t.w.includes("o")&&!/a(?!u|w)/.test(t.w)?"LOT":t.w.includes("a")&&!t.w.includes("o")?"PALM":"LOT";case"\u0254":return t.rCoda?"NORTH":tn.test(t.w)?"THOUGHT":"CLOTH";case"o\u028A":return t.rCoda?"FORCE":"GOAT";case"\u028C":return"STRUT";case"\u028A":return t.rCoda?"CURE":"FOOT";case"u":return t.rCoda?"CURE":"GOOSE";case"\u025D":case"\u025A":return t.stressed?"NURSE":"lettER";case"\u0259":return t.last&&t.next===void 0&&!t.single?"commA":void 0;case"a\u026A":return"PRICE";case"a\u028A":return"MOUTH";case"\u0254\u026A":return"CHOICE";default:return}}var on=new Map([["wind","W IH1 N D"],["read","R IY1 D"],["live","L IH1 V"],["lead","L IY1 D"],["close","K L OW1 Z"],["wound","W UW1 N D"]]),Oe=new Map([["a","AH0"],["an","AE1 N"],["the","DH AH0"],["of","AH1 V"],["to","T UW1"],["in","IH0 N"],["on","AA1 N"],["at","AE1 T"],["by","B AY1"],["for","F AO1 R"],["from","F R AH1 M"],["with","W IH1 DH"],["as","AE1 Z"],["and","AH0 N D"],["or","AO1 R"],["but","B AH1 T"],["nor","N AO1 R"],["so","S OW1"],["if","IH1 F"],["is","IH1 Z"],["am","AE1 M"],["are","AA1 R"],["was","W AA1 Z"],["were","W ER1"],["be","B IY1"],["been","B IH1 N"],["do","D UW1"],["does","D AH1 Z"],["did","D IH1 D"],["has","HH AE1 Z"],["have","HH AE1 V"],["had","HH AE1 D"],["will","W IH1 L"],["would","W UH1 D"],["can","K AE1 N"],["could","K UH1 D"],["should","SH UH1 D"],["shall","SH AE1 L"],["may","M EY1"],["might","M AY1 T"],["must","M AH1 S T"],["it","IH1 T"],["its","IH1 T S"],["i","AY1"],["you","Y UW1"],["he","HH IY1"],["she","SH IY1"],["we","W IY1"],["they","DH EY1"],["me","M IY1"],["him","HH IH1 M"],["her","HH ER1"],["us","AH1 S"],["them","DH EH1 M"],["my","M AY1"],["your","Y AO1 R"],["his","HH IH1 Z"],["our","AW1 ER0"],["their","DH EH1 R"],["this","DH IH1 S"],["that","DH AE1 T"],["than","DH AE1 N"],["then","DH EH1 N"],["there","DH EH1 R"],["not","N AA1 T"],["no","N OW1"]]),rn=new Map([["one","W AH1 N"],["once","W AH1 N S"],["what","W AH1 T"],["who","HH UW1"],["two","T UW1"],["into","IH1 N T UW0"],["through","TH R UW1"],["where","W EH1 R"],["these","DH IY1 Z"],["those","DH OW1 Z"],["thee","DH IY1"],["thou","DH AW1"],["thy","DH AY1"],["thine","DH AY1 N"],["though","DH OW1"],["people","P IY1 P AH0 L"],["eye","AY1"],["eyes","AY1 Z"],["said","S EH1 D"],["any","EH1 N IY0"],["many","M EH1 N IY0"],["anywhere","EH1 N IY0 W EH2 R"],["anything","EH1 N IY0 TH IH2 NG"],["anyone","EH1 N IY0 W AH2 N"],["everything","EH1 V R IY0 TH IH2 NG"],["everywhere","EH1 V R IY0 W EH2 R"],["everyone","EH1 V R IY0 W AH2 N"],["great","G R EY1 T"],["friend","F R EH1 N D"],["hour","AW1 R"],["whole","HH OW1 L"],["woman","W UH1 M AH0 N"],["women","W IH1 M AH0 N"],["touch","T AH1 CH"],["ocean","OW1 SH AH0 N"],["together","T AH0 G EH1 DH ER0"],["get","G EH1 T"],["forget","F ER0 G EH1 T"],["give","G IH1 V"],["again","AH0 G EH1 N"],["against","AH0 G EH1 N S T"],["because","B IH0 K AO1 Z"],["even","IY1 V IH0 N"],["busy","B IH1 Z IY0"],["sure","SH UH1 R"],["sugar","SH UH1 G ER0"],["enough","IH0 N AH1 F"],["young","Y AH1 NG"],["done","D AH1 N"],["gone","G AO1 N"],["none","N AH1 N"],["bear","B EH1 R"],["wear","W EH1 R"],["break","B R EY1 K"],["guy","G AY1"],["buy","B AY1"],["lose","L UW1 Z"],["move","M UW1 V"],["goes","G OW1 Z"],["door","D AO1 R"],["fire","F AY1 R"],["desire","D IH0 Z AY1 R"],["i'm","AY1 M"],["i'll","AY1 L"],["i've","AY1 V"],["i'd","AY1 D"],["you're","Y UH1 R"],["you'll","Y UW1 L"],["you've","Y UW1 V"],["we're","W IY1 R"],["we'll","W IY1 L"],["they're","DH EH1 R"],["don't","D OW1 N T"],["won't","W OW1 N T"],["can't","K AE1 N T"],["isn't","IH1 Z AH0 N T"],["it's","IH1 T S"],["that's","DH AE1 T S"],["there's","DH EH1 R Z"],["let's","L EH1 T S"],["ain't","EY1 N T"],["didn't","D IH1 D AH0 N T"],["doesn't","D AH1 Z AH0 N T"],["wasn't","W AA1 Z AH0 N T"],["couldn't","K UH1 D AH0 N T"],["wouldn't","W UH1 D AH0 N T"],["shouldn't","SH UH1 D AH0 N T"],["he's","HH IY1 Z"],["she's","SH IY1 Z"],["what's","W AH1 T S"],["o'er","OW1 R"],["ne'er","N EH1 R"],["e'er","EH1 R"]]),an=new Set(["\u028C","\xE6","\u0251","\u025B","\u0254","u","\u028A"]),sn=new Set(["you","do","to","who","not","no"]),ln=/[\u0300-\u036F]/g,cn=/^'+|'+$/g;function be(e,t={}){let r=e.toLowerCase().replace(cn,""),n=r.normalize("NFD").replace(ln,""),o=on.get(n)??un(t.dictionary,r,n)??Oe.get(n)??rn.get(n);if(o){let a=K(o);return t.reduce&&Oe.has(n)&&dn(a,n),a}if(r.includes("-")){let a=[];for(let i of r.split("-"))a.push(...be(i,t));return a}return Ae(n)}function un(e,t,r){if(e)return e.get(t)||(r!==t?e.get(r):void 0)}function dn(e,t){let r=0;for(let n of e)f(n.ipa)&&r++;for(let n of e)f(n.ipa)&&(n.stress=0,r===1&&an.has(n.ipa)&&!sn.has(t)&&(n.ipa="\u0259"))}function Z(e={}){return{starts:He,continues:t=>t==="-"||He(t)||t>="\u0300"&&t<="\u036F",word:t=>hn(t,e)}}function hn(e,t){let r=e.split("-").filter(o=>o!==""),n=[];for(let o of r){let a=be(o,t);Q(o,a);let i=w(a);if(i.length===0){let l=D(a);l&&i.push(l)}let s=r.length>1?[o]:Re(o,i.length);for(let l=0;l<i.length;l++){let{onset:c,nucleus:u,coda:h}=i[l];n.push({text:s[l]??"~",onset:c,nucleus:u,coda:h,wordEnd:!1,phraseEnd:!1})}}return n}function He(e){if(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="'")return!0;if(e<"\xC0")return!1;let t=e.normalize("NFD");if(t.length<2)return!1;let r=t[0];if(!(r>="a"&&r<="z"||r>="A"&&r<="Z"))return!1;for(let n=1;n<t.length;n++)if(t[n]<"\u0300"||t[n]>"\u036F")return!1;return!0}var M="/",q={starts:e=>e===M,continues:e=>e!==M&&e!==`
|
|
3
|
+
`&&e!=="\r",word:e=>pn(gn(e))};function pn(e){let{segments:t,breaks:r}=j(e),n=[],o=[[]];for(let a=0;a<t.length;a++){let i=t[a];if(i.ipa===N){n.length>0&&(n[n.length-1].phraseEnd=!0);continue}o[o.length-1].push(i),r[a]===v||a===t.length-1?(fn(o,n),o=[[]]):r[a]===V&&o.push([])}return n}function fn(e,t){let r=e.length>1?En(e):w(e[0]);if(r.length===0){let n=D(e.flat());if(!n)return;r.push(n)}for(let n=0;n<r.length;n++){let{onset:o,nucleus:a,coda:i}=r[n];t.push({text:mn(r[n]),onset:o,nucleus:a,coda:i,wordEnd:n===r.length-1,phraseEnd:!1})}}function En(e){let t=[],r=[];for(let n of e){let o=w(n);if(o.length===0){t.length>0?t[t.length-1].coda.push(...n):r.push(...n);continue}r.length>0&&(o[0].onset.unshift(...r),r=[]),t.push(...o)}return t}function mn(e){let t=e.nucleus.stress===1?"\u02C8":e.nucleus.stress===2?"\u02CC":"";for(let r of e.onset)t+=r.ipa;t+=e.nucleus.ipa;for(let r of e.coda)t+=r.ipa;return t}function gn(e){let t=e.startsWith(M)?1:0,r=e.length>t&&e.endsWith(M)?e.length-1:e.length;return e.slice(t,r)}function Ce(e,t,r={}){let n=r.t??"flap",o=r.l??"dark-coda",a=[],i=()=>{a.length>0&&Tn(a,n,o),a=[]};for(let s of e){if(!t(s)||s.melisma){i();continue}let l=[...s.onset,s.nucleus,...s.coda];l.forEach((c,u)=>a.push({seg:c,wordEnd:s.wordEnd&&u===l.length-1})),s.phraseEnd&&i()}i()}function Tn(e,t,r){if(t==="flap")for(let n=1;n+1<e.length;n++){let o=e[n-1],a=e[n+1],i=e[n].seg;(i.ipa==="t"||i.ipa==="d")&&(f(o.seg.ipa)||o.seg.ipa==="\u0279")&&f(a.seg.ipa)&&!(a.seg.stress!==void 0&&a.seg.stress!==0)&&!o.wordEnd&&(i.ipa="\u027E")}else if(t==="glottal"||t==="glottal-coda")for(let n=1;n<e.length;n++){let o=e[n].seg,a=e[n-1].seg.ipa;if(o.ipa!=="t"||!(f(a)||a==="n"||a==="l"))continue;let i=e[n+1]?.seg,s=i===void 0?t==="glottal":!f(i.ipa)&&!An.has(i.ipa),l=t==="glottal"&&i!==void 0&&f(i.ipa)&&!(i.stress!==void 0&&i.stress!==0)&&!e[n-1].wordEnd&&f(e[n-1].seg.ipa);(s||l)&&(o.ipa="\u0294")}if(r!=="clear")for(let n=0;n<e.length;n++){if(e[n].seg.ipa!=="l")continue;let a=!(n+1<e.length&&f(e[n+1].seg.ipa))||e[n].wordEnd;r==="dark"?e[n].seg.ipa="\u026B":a&&(e[n].seg.ipa=r==="vocalized"?"w":"\u026B")}}var An=new Set(["\u0279","w","j"]);var J={tune:"fall",range:4,declination:2,rate:1},ee={id:"general-american",name:"General American",region:"North America",rhotic:!0,sets:{NEAR:"\u026A",SQUARE:"\u025B",FORCE:"\u0254",CURE:"\u028A"},t:"flap",l:"dark-coda",th:"fricative",r:"approximant"},ye={id:"southern-british",name:"Southern British",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"i\u02D0",FACE:"e\u026A",PALM:"\u0251\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0259\u028A",GOOSE:"\u0289\u02D0",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B\u02D0",START:"\u0251\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.55,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:6,declination:3,rate:1}},Ne={id:"london",name:"London",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"\u0259i",FACE:"\xE6\u026A",PALM:"\u0251\u02D0",THOUGHT:"o\u02D0",GOAT:"\u028C\u028A",GOOSE:"\u0289\u02D0",PRICE:"\u0251\u026A",CHOICE:"o\u026A",MOUTH:"\xE6\u028A",NEAR:"\u026A\u0259",SQUARE:"e\u02D0",START:"\u0251\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal",l:"vocalized",th:"front",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:5,declination:2,rate:1.05}},we={id:"australian",name:"Australian",region:"Southern hemisphere",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0254",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0250\u02D0",CLOTH:"\u0254",NURSE:"\u0275\u02D0",FLEECE:"\u026Ai",FACE:"\xE6\u026A",PALM:"\u0250\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0250\u0289",GOOSE:"\u0289\u02D0",PRICE:"\u0252e",CHOICE:"o\u026A",MOUTH:"\xE6\u0254",NEAR:"\u026A\u0259",SQUARE:"e\u02D0",START:"\u0250\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"o\u02D0",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.45,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"rise",range:4,declination:1.5,rate:1}},Ie={id:"new-zealand",name:"New Zealand",region:"Southern hemisphere",rhotic:!1,sets:{KIT:"\u0258",DRESS:"e",TRAP:"\u025B",LOT:"\u0252",STRUT:"\u0250",FOOT:"\u028A",BATH:"\u0250\u02D0",CLOTH:"\u0252",NURSE:"\xF8\u02D0",FLEECE:"\u026Ai",FACE:"\xE6\u026A",PALM:"\u0250\u02D0",THOUGHT:"o\u02D0",GOAT:"\u0250\u0289",GOOSE:"\u0289\u02D0",PRICE:"\u0252e",CHOICE:"oe",MOUTH:"\xE6\u028A",NEAR:"i\u0259",SQUARE:"i\u0259",START:"\u0250\u02D0",NORTH:"o\u02D0",FORCE:"o\u02D0",CURE:"\u0289\u0259",happY:"i",lettER:"\u0258",commA:"\u0258"},hold:.45,t:"flap",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"rise",range:3.5,declination:1.5,rate:1.05}},Le={id:"irish",name:"Irish",region:"Scotland, Wales and Ireland",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",LOT:"\u0251",STRUT:"\u0250",FOOT:"\u028A",BATH:"a\u02D0",CLOTH:"\u0252",FLEECE:"i\u02D0",FACE:"e\u02D0",PALM:"a\u02D0",THOUGHT:"\u0252\u02D0",GOAT:"o\u02D0",GOOSE:"u\u02D0",PRICE:"\u0251\u026A",CHOICE:"\u0252\u026A",MOUTH:"\u0250\u028A",NEAR:"i",SQUARE:"e",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"u",happY:"i"},hold:.6,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:1.05}},Ue={id:"scottish",name:"Scottish",region:"Scotland, Wales and Ireland",rhotic:!0,sets:{KIT:"\u0258",DRESS:"\u025B",TRAP:"a",LOT:"\u0254",STRUT:"\u028C",FOOT:"\u0289",BATH:"a",CLOTH:"\u0254",NURSE:"\u028C\u027E",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"\u0289",PRICE:"\u028C\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u028C\u0289",NEAR:"i\u027E",SQUARE:"e\u027E",START:"a\u027E",NORTH:"\u0254\u027E",FORCE:"o\u027E",CURE:"\u0289\u027E",happY:"e",lettER:"\u0259\u027E",commA:"\u028C"},hold:.5,t:"glottal-coda",l:"dark",th:"fricative",r:"tap",prosody:{tune:"fall",range:4,declination:2,rate:1}},xe={id:"southern-us",name:"Southern US",region:"North America",rhotic:!0,sets:{DRESS:"\u025B",TRAP:"\xE6",BATH:"\xE6",FACE:"\u025B\u026A",THOUGHT:"\u0252\u0254",CLOTH:"\u0252\u0254",GOAT:"\u025C\u0289",GOOSE:"\u0289",PRICE:"a\u02D0",MOUTH:"\xE6\u028A",CHOICE:"o\u026A"},hold:.5,t:"flap",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:.85}},Pe={id:"canadian",name:"Canadian",region:"North America",rhotic:!0,sets:{TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",THOUGHT:"\u0252",PALM:"\u0252",FACE:"e\u026A",GOAT:"o\u028A"},raised:{PRICE:"\u028C\u026A",MOUTH:"\u028C\u028A"},hold:.6,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1}},ve={id:"californian",name:"Californian",region:"North America",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0251",CLOTH:"\u0251",THOUGHT:"\u0251",FOOT:"\u0275",GOOSE:"\u0289",GOAT:"\u0275\u028A",FACE:"e\u026A"},hold:.55,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:1.05}},Fe={id:"new-york",name:"New York",region:"North America",rhotic:!1,sets:{TRAP:"\xE6",BATH:"e\u0259",LOT:"\u0251",PALM:"\u0251",CLOTH:"o\u0259",THOUGHT:"o\u0259",NORTH:"o\u0259",FORCE:"o\u0259",START:"\u0251",NURSE:"\u025C",PRICE:"\u0251\u026A",MOUTH:"\xE6\u028A",GOAT:"o\u028A",NEAR:"\u026A\u0259",SQUARE:"e\u0259",CURE:"\u028A\u0259",lettER:"\u0259"},hold:.55,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:5,declination:2,rate:1.1}},De={id:"northern-english",name:"Northern English",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"o",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"a",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"\u026A",lettER:"\u0259",commA:"\u0259"},hold:.6,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:4,declination:2,rate:1}},Me={id:"geordie",name:"Geordie (Tyneside)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e\u0259",PALM:"\u0251",THOUGHT:"\u0252",GOAT:"\u0275",GOOSE:"\u0289",PRICE:"\u025B\u026A",CHOICE:"\u0254\u026A",MOUTH:"u",NEAR:"i\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0252",FORCE:"\u0252",CURE:"\u0289\u0259",happY:"i",lettER:"\u0250",commA:"\u0250"},hold:.55,t:"glottal-coda",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"rise",range:5,declination:1.5,rate:1.05}},Be={id:"welsh",name:"Welsh",region:"Scotland, Wales and Ireland",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0259",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"o",GOAT:"o",GOOSE:"\u0289",PRICE:"\u0259\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0259\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"a",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"a"},hold:.55,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"rise",range:6,declination:1,rate:1,stressRatio:1.5}},Ge={id:"northern-irish",name:"Northern Irish (Belfast)",region:"Scotland, Wales and Ireland",rhotic:!0,sets:{KIT:"\u0258",DRESS:"\u025B",TRAP:"\u0251",BATH:"\u0251",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0250",FOOT:"\u0289",FLEECE:"i",FACE:"e\u0259",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"\u0289",PRICE:"\u025B\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0258\u0289",NEAR:"i",SQUARE:"e",START:"\u0251",NORTH:"\u0254",FORCE:"o",CURE:"\u0289",happY:"e"},hold:.5,t:"flap",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"rise",range:5,declination:1.5,rate:1.05}},ke={id:"south-african",name:"South African",region:"Southern hemisphere",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\u025B",BATH:"\u0251",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0250",FOOT:"\u028A",NURSE:"\xF8",FLEECE:"i",FACE:"e\u026A",PALM:"\u0251",THOUGHT:"o",GOAT:"\u0153\u028A",GOOSE:"\u0289",PRICE:"\u0251\u026A",CHOICE:"\u0254\u026A",MOUTH:"\xE6\u028A",NEAR:"\u026A\u0259",SQUARE:"e",START:"\u0251",NORTH:"o",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.55,t:"released",l:"clear",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1}},_e={id:"nigerian",name:"Nigerian",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0254",FOOT:"u",NURSE:"\u025B",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:4,declination:1.5,rate:1,stressRatio:1.1}},ze={id:"jamaican",name:"Jamaican",region:"Caribbean",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"a",CLOTH:"a",STRUT:"\u0254",FOOT:"\u028A",NURSE:"\u0254",FLEECE:"i",FACE:"ie",PALM:"a",THOUGHT:"a",GOAT:"uo",GOOSE:"u",PRICE:"a\u026A",CHOICE:"a\u026A",MOUTH:"\u0254\u028A",NEAR:"i\u025B",SQUARE:"i\u025B",START:"a",NORTH:"a",FORCE:"uo",CURE:"uo",happY:"i",lettER:"a",commA:"a"},hold:.45,t:"released",l:"clear",th:"stop",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:6,declination:1.5,rate:1.05,stressRatio:1.3}},We={id:"indian",name:"Indian",region:"Asia",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"\xE6",BATH:"\u0251",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0259",FOOT:"\u028A",NURSE:"\u0259\u027E",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u0259",SQUARE:"e",START:"\u0251",NORTH:"\u0254",FORCE:"o",CURE:"u\u0259",happY:"i",lettER:"\u0259\u027E",commA:"\u0259"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:5,declination:1.5,rate:1.05,stressRatio:1.25}},Ye={id:"singaporean",name:"Singaporean",region:"Asia",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"\u025B",BATH:"\u0251",LOT:"\u0254",CLOTH:"\u0254",STRUT:"\u0250",FOOT:"u",NURSE:"\u0259",FLEECE:"i",FACE:"e",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u028A\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal-coda",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:3,declination:1,rate:1.1,stressRatio:1}},Ve={id:"received-pronunciation",name:"Received Pronunciation (traditional)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"e",TRAP:"\xE6",LOT:"\u0252",STRUT:"\u028C",FOOT:"\u028A",BATH:"\u0251\u02D0",CLOTH:"\u0252",NURSE:"\u025C\u02D0",FLEECE:"i\u02D0",FACE:"e\u026A",PALM:"\u0251\u02D0",THOUGHT:"\u0254\u02D0",GOAT:"\u0259\u028A",GOOSE:"u\u02D0",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"\u026A\u0259",SQUARE:"\u025B\u0259",START:"\u0251\u02D0",NORTH:"\u0254\u02D0",FORCE:"\u0254\u02D0",CURE:"\u028A\u0259",happY:"\u026A",lettER:"\u0259",commA:"\u0259"},hold:.6,t:"released",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:7,declination:3,rate:.95}},je={id:"scouse",name:"Scouse (Liverpool)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025B\u02D0",FLEECE:"i\u02D0",FACE:"\u025B\u026A",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"\u0259\u0289",GOOSE:"\u0289",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u0259",SQUARE:"\u025B\u02D0",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u0289\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"rise",range:5,declination:1.5,rate:1.1}},Ke={id:"brummie",name:"Brummie (Birmingham)",region:"England",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u028A",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"\u0259i",FACE:"\u028C\u026A",PALM:"\u0251",THOUGHT:"\u0254",GOAT:"\u028C\u028A",GOOSE:"\u0259\u0289",PRICE:"\u0254\u026A",CHOICE:"o\u026A",MOUTH:"\xE6\u028A",NEAR:"i\u0259",SQUARE:"\u025B",START:"\u0251",NORTH:"\u0254",FORCE:"\u0254",CURE:"\u0289\u0259",happY:"i",lettER:"\u0259",commA:"\u0259"},hold:.5,t:"glottal-coda",l:"dark-coda",th:"fricative",r:"approximant",hDrop:!0,prosody:{tune:"fall",range:2.5,declination:1,rate:1}},$e={id:"west-country",name:"West Country",region:"England",rhotic:!0,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0250",FOOT:"\u028A",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0252",GOAT:"o",GOOSE:"\u0289",PRICE:"\u0250\u026A",CHOICE:"\u0254\u026A",MOUTH:"\u0250\u028A",NEAR:"i",SQUARE:"\u025B",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"\u0289",happY:"i"},hold:.55,t:"glottal-coda",l:"dark",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:.95}},Qe={id:"boston",name:"Boston",region:"North America",rhotic:!1,sets:{TRAP:"\xE6",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",THOUGHT:"\u0252",PALM:"a",START:"a",NURSE:"\u025C",NEAR:"\u026A\u0259",SQUARE:"\u025B\u0259",NORTH:"\u0254\u0259",FORCE:"\u0254\u0259",CURE:"\u028A\u0259",lettER:"\u0259",MOUTH:"a\u028A"},raised:{PRICE:"\u028C\u026A"},hold:.6,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4.5,declination:2,rate:1.1}},Ze={id:"inland-north",name:"Inland North (Chicago, Detroit)",region:"North America",rhotic:!0,sets:{TRAP:"e\u0259",BATH:"e\u0259",LOT:"a",PALM:"a",THOUGHT:"\u0251",CLOTH:"\u0251",DRESS:"\u025C",STRUT:"\u0254",KIT:"\u0258"},hold:.65,t:"flap",l:"dark-coda",th:"fricative",r:"approximant",prosody:{tune:"fall",range:4,declination:2,rate:1.05}},qe={id:"filipino",name:"Filipino",region:"Asia",rhotic:!0,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u025B\u027E",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i\u027E",SQUARE:"\u025B\u027E",START:"a\u027E",NORTH:"\u0254\u027E",FORCE:"o\u027E",CURE:"u\u027E",happY:"i",lettER:"\u025B\u027E",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"tap",prosody:{tune:"fall",range:4.5,declination:1.5,rate:1.05,stressRatio:1.15}},Xe={id:"ghanaian",name:"Ghanaian",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u025B",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"fall",range:5,declination:1.5,rate:1,stressRatio:1.1}},Je={id:"kenyan",name:"Kenyan",region:"Africa",rhotic:!1,sets:{KIT:"i",DRESS:"e",TRAP:"a",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"e",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"ia",SQUARE:"ea",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"ua",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"fricative",r:"tap",prosody:{tune:"fall",range:4,declination:1.5,rate:1,stressRatio:1.15}},et={id:"trinidadian",name:"Trinidadian",region:"Caribbean",rhotic:!1,sets:{KIT:"\u026A",DRESS:"\u025B",TRAP:"a",BATH:"a",LOT:"\u0252",CLOTH:"\u0252",STRUT:"\u0254",FOOT:"\u028A",NURSE:"\u025C",FLEECE:"i",FACE:"e",PALM:"a",THOUGHT:"\u0252",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0252\u026A",MOUTH:"\u0254\u028A",NEAR:"i\u025B",SQUARE:"\u025B",START:"a",NORTH:"\u0252",FORCE:"o",CURE:"\u028A\u0259",happY:"i",lettER:"a",commA:"a"},hold:.5,t:"released",l:"clear",th:"stop",r:"approximant",prosody:{tune:"rise",range:7,declination:1.5,rate:1.1,stressRatio:1.3}},tt={id:"russian",name:"Russian",region:"Europe",rhotic:!0,sets:{KIT:"i",DRESS:"\u025B",TRAP:"\u025B",BATH:"a",LOT:"\u0254",CLOTH:"\u0254",STRUT:"a",FOOT:"u",NURSE:"\u0275\u027E",FLEECE:"i",FACE:"ei",PALM:"a",THOUGHT:"\u0254",GOAT:"o",GOOSE:"u",PRICE:"a\u026A",CHOICE:"\u0254\u026A",MOUTH:"a\u028A",NEAR:"i",SQUARE:"\u025B",START:"a",NORTH:"\u0254",FORCE:"\u0254",CURE:"u",happY:"i",lettER:"\u025B\u027E",commA:"a"},hold:.5,t:"released",l:"dark",th:"sibilant",r:"tap",replace:{w:"v"},devoiceFinal:!0,prosody:{tune:"fall",range:6,declination:2.5,rate:.95,stressRatio:1.7}},Sn=["North America","England","Scotland, Wales and Ireland","Southern hemisphere","Africa","Caribbean","Asia","Europe"],X=Object.freeze(Object.fromEntries([ee,Pe,ve,Fe,Qe,Ze,xe,Ve,ye,Ne,$e,Ke,je,De,Me,Ue,Be,Le,Ge,we,Ie,ke,_e,Xe,Je,ze,et,We,Ye,qe,tt].map(e=>[e.id,e])));function te(e){if(e===void 0)return ee;if(typeof e!="string")return e;let t=X[e];if(!t)throw new Error(`unknown accent "${e}"; built in: ${Object.keys(X).join(", ")}`);return t}var Rn=/[ːˑ:]/g;function On(e){let t=Array.from(e.replace(Rn,"")),r,n=t[t.length-1];(n==="\u0279"||n==="\u027E"||n==="r")&&(r=n==="r"?"\u0279":n,t.pop());let o=t.filter(a=>f(a));if(o.length===0||o.length>2||o.length!==t.length)throw new Error(`accent realization "${e}" is not one or two vowels and an optional r`);return{vowels:o,r}}var nt=new Set(["\u0279","\u027E","r"]);function ne(e,t,r){for(let n=0;n<e.length;n++){let o=e[n];if(!t(o)||o.melisma)continue;let a=e[n+1],i=!o.phraseEnd&&a!==void 0&&t(a)&&!a.melisma&&a.onset.length===0,s=o.coda[0]??(!o.wordEnd&&a!==void 0?a.onset[0]:void 0),l=s!==void 0&&Hn.has(s.ipa);bn(o,r,i,l),Nn(o,r,n===0||e[n-1].wordEnd)}}var Hn=new Set(["p","t","k","f","\u03B8","s","\u0283","t\u0283","h"]);function bn(e,t,r,n){let o=e.nucleus,a=o.set,s=(a!==void 0&&n?t.raised?.[a]:void 0)??(a===void 0?void 0:t.sets[a]),l=o.ipa==="\u025D"||o.ipa==="\u025A";if(s!==void 0){let c=On(s);if(o.ipa=c.vowels.join(""),c.r!==void 0){let u=t.r==="tap"?"\u027E":c.r;e.coda.length>0&&nt.has(e.coda[0].ipa)?e.coda[0].ipa=u:e.coda.unshift({ipa:u})}else l&&!t.rhotic&&r&&e.coda.unshift({ipa:"\u0279"})}if(t.rhotic||Cn(e,r),Array.from(o.ipa).length===2&&a!==void 0){let c=t.holds?.[a]??t.hold;c!==void 0&&(o.hold=Math.max(0,Math.min(1,c)))}}function Cn(e,t){for(let r=e.coda.length-1;r>=0;r--)!nt.has(e.coda[r].ipa)||r===e.coda.length-1&&t||e.coda.splice(r,1)}var yn={b:"p",d:"t",g:"k",v:"f",z:"s",\u00F0:"\u03B8",\u0292:"\u0283",d\u0292:"t\u0283"};function Nn(e,t,r){let n=[e.onset,e.coda];for(let o of n)for(let a=0;a<o.length;a++){let i=o[a],s=r&&o===e.onset&&a===0;t.th==="stop"?i.ipa==="\u03B8"?i.ipa="t":i.ipa==="\xF0"&&(i.ipa="d"):t.th==="front"?i.ipa==="\u03B8"?i.ipa="f":i.ipa==="\xF0"&&(i.ipa=s?"d":"v"):t.th==="sibilant"&&(i.ipa==="\u03B8"?i.ipa="s":i.ipa==="\xF0"&&(i.ipa="z")),t.r==="tap"&&i.ipa==="\u0279"&&(i.ipa="\u027E");let l=t.replace?.[i.ipa];l!==void 0&&(i.ipa=l)}if(t.devoiceFinal&&e.wordEnd)for(let o=e.coda.length-1;o>=0;o--){let a=yn[e.coda[o].ipa];if(a===void 0)break;e.coda[o].ipa=a}t.hDrop&&r&&e.onset.length>0&&e.onset[0].ipa==="h"&&e.onset.shift()}var b=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],wn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],oe=["","thousand","million","billion","trillion"],In={one:"first",two:"second",three:"third",five:"fifth",eight:"eighth",nine:"ninth",twelve:"twelfth"};function Ln(e){let t=Math.floor(e/100),r=e%100,n=[];return t>0&&n.push(b[t],"hundred"),(r>0||t===0)&&n.push(r<20?b[r]:wn[Math.floor(r/10)]+(r%10?" "+b[r%10]:"")),n.join(" ")}function S(e){if(!Number.isFinite(e))return"";if(e<0)return"minus "+S(-e);if(e=Math.floor(e),e===0)return"zero";let t=[];for(let r=0;e>0&&r<oe.length;r++){let n=e%1e3;n>0&&t.unshift(Ln(n)+(oe[r]?" "+oe[r]:"")),e=Math.floor(e/1e3)}return t.join(" ")}function rt(e){let t=S(e),r=/([a-z]+)$/.exec(t);if(!r)return t;let n=r[1],o=In[n]??(n.endsWith("y")?n.slice(0,-1)+"ieth":n+"th");return t.slice(0,t.length-n.length)+o}function at(e){if(e>=2e3&&e<=2009)return S(e);let t=Math.floor(e/100),r=e%100;return r===0?S(t)+" hundred":S(t)+" "+(r<10?"oh "+b[r]:S(r))}var Un={a:"e\u026A",b:"bi",c:"si",d:"di",e:"i",f:"\u025Bf",g:"d\u0292i",h:"e\u026At\u0283",i:"a\u026A",j:"d\u0292e\u026A",k:"ke\u026A",l:"\u025Bl",m:"\u025Bm",n:"\u025Bn",o:"o\u028A",p:"pi",q:"kju",r:"\u0251\u0279",s:"\u025Bs",t:"ti",u:"ju",v:"vi",w:"d\u028C.b\u0259l.ju",x:"\u025Bks",y:"wa\u026A",z:"zi"},xn=new Set(["USA","UK","EU","AI","ID","IOU","CEO","UFO","DIY","FAQ","ATM","URL","API","USB","GPU","CPU","BBQ","DJ","MC","TBA","ETA","EP","LP"]);function it(e){let t=Array.from(e.toLowerCase()).map(n=>Un[n]).filter(n=>!!n);if(t.length===0)return e;let r=t.length-1;return"/"+t.map((n,o)=>o===r?"\u02C8"+n:n).join(".")+"/"}function re(e){return e.split(/(\/[^/]*\/)/).map((t,r)=>r%2===1?t:Pn(t)).join("")}function Pn(e){return e.replace(/&/g," and ").replace(/\$(\d{1,3}(?:,\d{3})+|\d+)(?:\.(\d{2}))?\b/g,(t,r,n)=>{let o=Number(r.replace(/,/g,"")),a=`${S(o)} ${o===1?"dollar":"dollars"}`,i=n?Number(n):0;return i?`${a} and ${S(i)} ${i===1?"cent":"cents"}`:a}).replace(/\b(\d{1,2}):(\d{2})\b/g,(t,r,n)=>{let o=Number(n);return`${S(Number(r))} ${o===0?"o'clock":o<10?"oh "+b[o]:S(o)}`}).replace(/\b(\d+)(st|nd|rd|th)\b/gi,(t,r)=>rt(Number(r))).replace(/\b(\d+(?:\.\d+)?)%/g,(t,r)=>`${ot(r)} percent`).replace(/\b\d{1,3}(?:,\d{3})+\b|\b\d+\.\d+\b|\b\d+\b/g,t=>/^\d{4}$/.test(t)&&Number(t)>=1100&&Number(t)<=2099?at(Number(t)):ot(t)).replace(/\b[A-Z]{2,6}\b/g,t=>!/[AEIOU]/.test(t)||xn.has(t)?it(t):t)}function ot(e){let t=e.replace(/,/g,""),[r,n]=t.split("."),o=S(Number(r));return n?`${o} point ${Array.from(n).map(a=>b[Number(a)]).join(" ")}`:o}var B=/\s/,vn=/[\p{L}\p{M}\p{N}]/u;function Fn(e){return e==="."||e===","||e===";"||e===":"||e==="!"||e==="?"||e===`
|
|
4
|
+
`}function st(e,t){let r=Array.from(e.normalize("NFC").replace(/’/g,"'")),n=[],o=0;for(;o<r.length;){let a=r[o],i=t.find(s=>s.starts(a));if(i){let s=i.continues(a)?Mn(r,o,i):Bn(r,o,i);if(s>o){Dn(n,i.word(r.slice(o,s).join(""))),o=s;continue}}if(Fn(a))n.length>0&&(n[n.length-1].phraseEnd=!0);else if(Gn(r,o)){let s=n[n.length-1];s&&n.push({text:"~",onset:[],nucleus:{...s.nucleus},coda:[],melisma:!0,wordEnd:s.wordEnd,phraseEnd:!1})}o++}return n}function ae(e,t={}){t.numbers!==!1&&(e=re(e));let r=Z({dictionary:t.dictionary,reduce:t.reduce}),n=new WeakSet,o={starts:r.starts,continues:r.continues,word:l=>{let c=r.word(l);for(let u of c)n.add(u);return c}},a=st(e,[o,q]),i=te(t.accent),s=l=>n.has(l);return ne(a,s,i),t.allophones!==!1&&Ce(a,s,{t:i.t,l:i.l}),a}function Dn(e,t){if(t.length!==0){t[t.length-1].wordEnd=!0;for(let r of t)e.push(r)}}function Mn(e,t,r){let n=t+1;for(;n<e.length&&r.continues(e[n]);)n++;return n}function Bn(e,t,r){let n=e[t];if(t>0&&vn.test(e[t-1])||t+1>=e.length||e[t+1]===n||B.test(e[t+1]))return t;let o=t+1;for(;o<e.length&&e[o]!==n&&r.continues(e[o]);)o++;return o>=e.length||e[o]!==n||B.test(e[o-1])?t:o+1}function Gn(e,t){let r=e[t];if(r!=="-"&&r!=="~")return!1;let n=t===0||B.test(e[t-1]),o=t+1===e.length||B.test(e[t+1]);return n&&o}var kn=/^(\S+)\s+(.+)$/,_n=/\(\d+\)$/;function zn(e){let t=new Map;for(let r of e.split(`
|
|
5
|
+
`)){let n=r.trim();if(n===""||n.startsWith(";;;"))continue;let o=kn.exec(n);if(!o)continue;let a=o[1];if(_n.test(a))continue;let i=o[2].indexOf("#"),s=(i<0?o[2]:o[2].slice(0,i)).trim().split(/\s+/).join(" ");if(s==="")continue;let l=a.toLowerCase();t.has(l)||t.set(l,s)}return t}import{clamp as k}from"bellowsjs";var Wn=Object.freeze({p:.085,b:.07,t:.075,d:.06,\u0288:.075,\u0256:.065,c:.08,\u025F:.07,k:.08,g:.07,q:.085,\u0262:.075,\u0294:.06,m:.075,\u0271:.075,n:.07,\u0273:.07,\u0272:.075,\u014B:.08,\u0274:.08,\u0278:.11,\u03B2:.09,f:.11,v:.08,\u03B8:.11,\u00F0:.07,s:.12,z:.09,\u0283:.12,\u0292:.09,\u0282:.12,\u0290:.09,\u00E7:.12,\u029D:.09,x:.12,\u0263:.09,\u03C7:.12,\u0281:.09,\u0127:.12,\u0295:.09,h:.09,\u0266:.08,\u026C:.12,\u026E:.09,ts:.14,dz:.12,t\u0283:.15,d\u0292:.13,\u0255:.12,\u0291:.09,t\u0255:.14,d\u0291:.12,t\u0282:.14,d\u0290:.12,pf:.14,w:.06,\u028B:.06,\u0279:.065,\u027B:.065,j:.055,\u0265:.055,\u0270:.06,l:.065,\u026B:.075,\u026D:.065,\u028E:.07,\u027E:.025,\u027D:.03,r:.11,\u0280:.11,\u0299:.12}),Yn=.07,ut=.8;var lt=new Map(Object.entries(Wn)),Vn=new Map([["\u0261","g"],["\u02A3","dz"],["\u02A4","d\u0292"],["\u02A5","d\u0291"],["\u02A6","ts"],["\u02A7","t\u0283"],["\u02A8","t\u0255"]]),jn=/[ʰ-˿̀-ͯ]/g;function ct(e){let t=lt.get(e);if(t!==void 0)return t;let r=Vn.get(e);return r===void 0?void 0:lt.get(r)}function C(e){return ct(e)??ct(e.replace(jn,""))??Yn}var Kn=.05,$n=.012,Qn=.02,Zn=.12,qn=.3,Xn=.8,Jn=.001,eo=.8,to=4,no=86400,oo=10,ro=new Map([["a\u026A",["a","\u026A"]],["a\u028A",["a","\u028A"]],["e\u026A",["e","i"]],["o\u028A",["o","u"]],["\u0254\u026A",["\u0254","\u026A"]]]);function ao(e){let t=ro.get(e);if(t!==void 0||e.length!==2)return t;let r=e[0],n=e[1];return f(r)&&f(n)?[r,n]:void 0}var io={text:"ah",onset:[],nucleus:{ipa:"\u0251",stress:1},coda:[],wordEnd:!0,phraseEnd:!1};function so(e,t,r={}){let n=k(r.consonantScale??ut,0,to),o=lo(e,t),a=o.length;if(a===0)return{phrases:[],leadIn:0};let i=new Array(a);for(let d=0;d<a;d++){let p=o[d];i[d]=d===a-1||p.syl.phraseEnd||o[d+1].time-(p.time+p.len)>Jn}let s=new Array(a),l=new Array(a),c=0;for(let d=0;d<a;d++){d>0&&i[d-1]&&(c=d),s[d]=o[d].syl.melisma===!0?[]:dt(o[d].syl.onset,n);let p=!i[d]&&o[d+1].syl.melisma===!0;l[d]=p?[]:dt(co(o,d,c).coda,n)}let u=new Array(a);for(let d=0;d<a;d++){let p=o[d];if(i[d])if(d+1<a){let m=o[d+1].time,R=m-p.time,A=Math.min(p.len,R),L=p.syl.phraseEnd?Math.min(Zn,qn*A):0;G(l[d].concat(s[d+1]),R-L),G(l[d],A),u[d]=Math.max(p.time,Math.min(p.time+A,m-I(s[d+1])-L))}else G(l[d],p.len),u[d]=p.time+p.len;else{let m=o[d+1].time;G(l[d].concat(s[d+1]),m-p.time),u[d]=Math.max(p.time,m-I(s[d+1]))}}let h=[],E=0;for(let d=0;d<a;){let p=d;for(;!i[p];)p++;let m=uo(o,s,l,u,d,p);m!==void 0&&(h.push(m),E=Math.max(E,o[d].time-m.start)),d=p+1}return{phrases:h,leadIn:E}}function lo(e,t){let r=[];for(let o of e)Number.isFinite(o.time)&&Number.isFinite(o.hz)&&o.hz>0&&r.push(o);r.sort((o,a)=>o.time-a.time);let n=t.length>0?t:[io];return r.map((o,a)=>({time:o.time,len:k(o.dur,0,no),hz:o.hz,vel:k(o.vel??eo,0,1),syl:n[a%n.length]}))}function co(e,t,r){let n=t;for(;n>r&&e[n].syl.melisma===!0;)n--;return e[n].syl}function dt(e,t){let r=[];for(let n of e){let o=n.dur,a=typeof o=="number"&&Number.isFinite(o)?k(o,0,oo):C(n.ipa)*t;r.push({ipa:n.ipa,dur:a})}return r}function I(e){let t=0;for(let r of e)t+=r.dur;return t}function G(e,t){let r=I(e),n=t-Kn;if(r<=n||r<=0)return;let o=Math.max(0,n)/r,a=0;for(let s of e)s.dur=Math.max(Math.min(s.dur,$n),s.dur*o),a+=s.dur;let i=a+Qn;if(i>t){let s=Math.max(0,t)/i;for(let l of e)l.dur*=s}}function uo(e,t,r,n,o,a){let i=[],s=e[o].time,l=s-I(t[o]),c=[{time:l,hz:e[o].hz}];ie(i,t[o],l,s,"onset");for(let u=o;u<=a;u++){let h=e[u],E=n[u],d=Math.max(h.time,E-I(r[u])),p=u===a||e[u+1].syl.melisma!==!0,m=u>o&&h.syl.melisma===!0;ho(i,h.syl.nucleus,h.time,d,p,m),ie(i,r[u],d,E,"coda"),u<a&&(c.push({time:E,hz:e[u+1].hz}),ie(i,t[u+1],E,e[u+1].time,"onset"))}if(i.length!==0)return{start:i[0].start,end:i[i.length-1].end,vel:e[o].vel,spans:i,pitches:c}}function ie(e,t,r,n,o){let a=r;for(let i=0;i<t.length;i++){let s=i===t.length-1?n:Math.min(n,a+t[i].dur);s>a&&e.push({ipa:t[i].ipa,start:a,end:s,kind:o}),a=s}}function ho(e,t,r,n,o,a){let i=t.ipa,s=ao(i);if(s!==void 0&&o){let l=r+(t.hold??Xn)*(n-r);se(e,s[0],r,l,a),se(e,s[1],l,n,!1)}else se(e,s===void 0?i:s[0],r,n,a)}function se(e,t,r,n,o){if(!(n>r))return;let a=e[e.length-1],i=a!==void 0&&a.kind==="nucleus"&&a.ipa===t;if(o&&i&&a.end===r){a.end=n;return}e.push({ipa:t,start:r,end:n,kind:"nucleus"})}function pt(e,t={}){let r=ae(e,t),n=[],o=[],a=[];for(let i of r){if(o.push(i),!i.wordEnd)continue;let s=ht(o);n.push(s),a.push(s.ipa,i.phraseEnd?" | ":" "),o=[]}if(o.length>0){let i=ht(o);n.push(i),a.push(i.ipa)}return{words:n,ipa:a.join("").replace(/ \| $/,"").trim(),syllables:r}}function po(e,t={}){return pt(e,t).ipa}function ht(e){let t=e.filter(n=>!n.melisma).length>1,r=e.filter(n=>!n.melisma).map(n=>{let o=t&&n.nucleus.stress===1?"\u02C8":t&&n.nucleus.stress===2?"\u02CC":"",a=[...n.onset,n.nucleus,...n.coda].map(i=>i.ipa).join("");return o+a}).join(".");return{text:e.map(n=>n.text).join("-"),ipa:r,syllables:e,sets:e.map(n=>n.nucleus.set)}}var Tt=.18,At=.09,ft=Tt+At,le=2,fo=1.5,Et={i:155,\u026A:135,e:190,e\u026A:190,\u025B:150,\u00E6:230,a:230,\u0251:240,\u0252:240,\u0254:240,o:220,o\u028A:220,\u028A:160,u:210,\u028C:140,\u0259:120,\u025A:180,\u025D:180,a\u026A:250,a\u028A:240,\u0254\u026A:280,\u0268:110},mt=180,Eo=new Set(["v","\xF0","z","\u0292"]),mo=new Set(["b","d","g","d\u0292"]),go=new Set(["p","t","k","t\u0283","\u0294"]),To=new Set(["m","n","\u014B"]);function Ao(e){return e===void 0?1:Eo.has(e)?1.6:mo.has(e)?1.2:go.has(e)?.7:To.has(e)?.85:1}function So(e,t,r){let n=e[t],o=n.nucleus.ipa,a=Et[o]??Et[Array.from(o)[0]]??mt,i=Math.max(.65,Math.min(1.45,a/mt)),s=t;for(;s>0&&!e[s-1].wordEnd;)s--;let l=t;for(;l<e.length-1&&!e[l].wordEnd;)l++;l>s&&(i*=.8),!n.wordEnd&&t<l&&(i*=.85);let c=n.coda[0]?.ipa??(t<l?e[t+1].onset[0]?.ipa:void 0),u=Ao(c);return i*=r?u:.7+.3*u,i}var Ro=.28,Oo=.32,gt=.05;function Ho(e,t={},r=[]){let n=t.prosody??J,o=t.hz!==void 0&&t.hz>0?t.hz:110,a=Math.max(.1,(t.rate??1)*n.rate),i=Math.max(.5,n.stressRatio??le),s=i===le?At:ft/(1+i),l=i===le?Tt:ft*i/(1+i),c=[],u=[],h=t.breath??"between",E=Oo/Math.sqrt(a),d=0,p=0;for(let m=0;m<e.length;){let R=m;for(;R<e.length-1&&!e[R].phraseEnd;)R++;let A=e.slice(m,R+1);if(h==="all"||h==="between"&&p>0){let g=A[0],T=p>0?"beat:in>":"beat:in";A[0]={...g,onset:[{ipa:T,dur:E},{ipa:"_",dur:gt},...g.onset]}}let L=r[p]??n.tune==="rise",{pitches:ce,endTone:ue}=bo(A,n,L);for(let g=0;g<A.length;g++){let T=A[g],H=g===A.length-1,Ct=T.nucleus.stress!==void 0&&T.nucleus.stress>0,U=T.nucleus.dur??(Ct?l:s)*So(A,g,H);H&&(U*=fo);let x=0;for(let O of T.coda)x+=O.dur??C(O.ipa);if(!H)for(let O of A[g+1].onset)x+=O.dur??C(O.ipa);if(H&&ue!==void 0){let O=.45*U/a,he=(.55*U+x)/a;u.push({...T,phraseEnd:!1,wordEnd:!1}),u.push({text:"~",onset:[],nucleus:{...T.nucleus},coda:[],melisma:!0,wordEnd:T.wordEnd,phraseEnd:T.phraseEnd}),c.push({time:d,dur:O,hz:o*2**(ce[g]/12)}),c.push({time:d+O,dur:he,hz:o*2**(ue/12)}),d+=O+he;continue}let de=(U+x)/a;u.push(T),c.push({time:d,dur:de,hz:o*2**(ce[g]/12)}),d+=de}if(R<e.length-1){let g=0;for(let H of e[R+1].onset)g+=H.dur??C(H.ipa);h!=="none"&&(g+=E+gt);let T=Ro/a+g;c.push({time:d,dur:T,hz:0,rest:!0}),d+=T}p++,m=R+1}return{syllables:u,notes:c}}function bo(e,t,r){let n=e.length,o=-1;for(let i=n-1;i>=0;i--){let s=e[i].nucleus.stress;if(s!==void 0&&s>0){o=i;break}}o<0&&(o=n-1);let a=[];for(let i=0;i<n;i++){let s=n>1?-t.declination*(i/(n-1)):0,l=e[i].nucleus.stress??0,c=s;if(i<o)l===1?c+=t.range*(i===Co(e)?1:.7):l===2&&(c+=t.range*.35);else if(i===o)c+=r?-.25*t.range:t.range;else{let u=(i-o)/(n-1-o);c+=r?t.range*(.4+.8*u):-.6*t.range*u-.2*t.range}a.push(c)}return o<n-1?{pitches:a}:{pitches:a,endTone:r?-t.declination+t.range:-t.declination-.4*t.range}}function Co(e){for(let t=0;t<e.length;t++)if(e[t].nucleus.stress===1)return t;return-1}var St=256;function Rt(e){let t=[];for(let r of e.split(/[\s|]+/)){if(r==="")continue;if(t.length===St)break;if(r==="."||r==="-"){t.push(null);continue}let n=r,o=!1;n.length>1&&n.endsWith(">")&&(o=!0,n=n.slice(0,-1));let a,i=/^(.+?):(\d+)$/.exec(n);i&&(n=i[1],a=Number(i[2]));let s=pe(n);if(s<=0){t.push(null);continue}let l={id:y[s].id};a!==void 0&&(l.note=a),o&&(l.accent=!0),t.push(l)}return t}function yo(e){let t=e.map(n=>n===null?".":`${n.id}${n.note!==void 0?`:${n.note}`:""}${n.accent?">":""}`),r=[];for(let n=0;n<t.length;n+=4)r.push(t.slice(n,n+4).join(" "));return r.join(" | ")}var No=[{id:"boots-and-cats",name:"Boots and cats",bpm:96,swing:0,text:"B . t . | Pf . t . | B . t . | Pf . t ."},{id:"four-on-the-floor",name:"Four on the floor",bpm:122,swing:0,text:"B . t . | B . tss . | B . t . | B . tss ."},{id:"breakbeat",name:"Breakbeat",bpm:94,swing:.18,text:"B . t . | Pf . t B | . B t . | Pf . t t"},{id:"rimshot-shuffle",name:"Rimshot shuffle",bpm:88,swing:.4,text:"B . t K | . t B . | t . K t | . B K t"},{id:"inward-snare",name:"Inward snare",bpm:100,swing:0,text:"B . t . | ^K . t . | B B t . | ^K . t ."},{id:"clicks-and-pops",name:"Clicks and pops",bpm:90,swing:.25,text:"B . ! . | P! . ! . | B ! . ! | P! . ! !"},{id:"hum-bass",name:"Hum bass",bpm:92,swing:.1,text:"B m . m:43 | Pf . m:45 . | B m:40 . m | Pf . t kch"},{id:"psh-groove",name:"Psh groove",bpm:98,swing:.12,text:"B . ch . | Psh . ch B | . B ch . | Psh . ch tss"}],Ot=.15;function Ht(e){return 60/Math.max(20,Math.min(400,e))/4}function wo(e,t={}){let r=typeof e=="string"?Rt(e):e,n=Math.max(1,Math.min(64,Math.floor(t.repeat??1))),o=Ht(t.bpm??96),a=Math.max(0,Math.min(.6,t.swing??0))*.5*o,i=[null],s=[Ot];for(let c=0;c<n;c++)for(let u=0;u<r.length;u++)i.push(r[u]),s.push(o+(u%2===0?a:-a));return{syllables:i.map(c=>({text:c===null?".":c.id,onset:[],nucleus:{ipa:`${fe}${c===null?".":c.id}${c?.accent?">":""}`},coda:[],wordEnd:!0,phraseEnd:!1})),durs:s,steps:i}}var Io={bilabial:"the two lips",labiodental:"the lower lip against the upper teeth",dental:"the tongue tip against the upper teeth",alveolar:"the tongue tip against the ridge behind the upper teeth",postalveolar:"the front of the tongue just behind the ridge behind the upper teeth, lips a little rounded",palatal:"the middle of the tongue against the hard roof of the mouth",velar:"the back of the tongue against the soft palate",glottal:"the vocal folds themselves"},Lo={p:["stop","bilabial",!1,"pin"],b:["stop","bilabial",!0,"bin"],t:["stop","alveolar",!1,"tin"],d:["stop","alveolar",!0,"din"],k:["stop","velar",!1,"kin"],g:["stop","velar",!0,"go"],f:["fricative","labiodental",!1,"fan"],v:["fricative","labiodental",!0,"van"],\u03B8:["fricative","dental",!1,"thin"],\u00F0:["fricative","dental",!0,"this"],s:["fricative","alveolar",!1,"sip"],z:["fricative","alveolar",!0,"zip"],\u0283:["fricative","postalveolar",!1,"ship"],\u0292:["fricative","postalveolar",!0,"measure"],h:["fricative","glottal",!1,"hat"],t\u0283:["affricate","postalveolar",!1,"chin"],d\u0292:["affricate","postalveolar",!0,"gin"],m:["nasal","bilabial",!0,"man"],n:["nasal","alveolar",!0,"no"],\u014B:["nasal","velar",!0,"sing"],l:["lateral","alveolar",!0,"let"],\u026B:["lateral","alveolar",!0,"tell"],\u0279:["approximant","alveolar",!0,"red"],w:["approximant","bilabial",!0,"wet"],j:["approximant","palatal",!0,"yes"],\u027E:["tap","alveolar",!0,'the t in American "water"'],\u0294:["stop","glottal",!1,'the catch in "uh-oh"']},Uo={i:[0,0,!1,"heed"],\u026A:[.7,.2,!1,"hid"],e:[1,0,!1,"hay (its start)"],\u025B:[2,0,!1,"head"],\u00E6:[2.7,0,!1,"had"],a:[3,.5,!1,"high (its start)"],\u0251:[3,2,!1,"hod, father"],\u0252:[3,2,!0,'British "hot"'],\u0254:[2,2,!0,"hawed"],o:[1,2,!0,"hoe (its start)"],\u028A:[.7,1.8,!0,"hood"],u:[0,2,!0,"who'd"],\u028C:[2,1.5,!1,"hud"],\u0259:[1.5,1,!1,'the a in "about"'],\u025D:[1.5,1,!1,"heard"],\u0250:[2.5,1,!1,'Australian "cut"'],\u025C:[2,1,!1,'British "nurse"'],\u0289:[0,1,!0,'Australian "goose"'],\u0268:[0,1,!1,'Russian "\u0442\u044B"'],\u0258:[1,1,!1,'a central "e"'],\u0275:[1,1,!0,'New Zealand "foot"'],y:[0,0,!0,'French "tu"'],\u00F8:[1,0,!0,'French "peu"'],\u0153:[2,0,!0,'French "peur"'],\u026F:[0,2,!1,'Japanese "u"'],\u0264:[1,2,!1,'an unrounded "o"']};function xo(e){if(e.startsWith("beat:")){let n=e.slice(5).replace(/>$/,""),o=y.find(a=>a.id===n);return o?`${o.name}: ${o.hint.charAt(0).toLowerCase()}${o.hint.slice(1)}.`:void 0}if(e==="_")return"Silence: the breath stops.";let t=Lo[e];if(t){let[n,o,a,i]=t,s=Io[o],l=a?"The voice buzzes through it.":"The voice is off: only air.";return`${{stop:`Made with ${s}: they close completely, air builds up behind them, then they let go with a small pop.`,fricative:o==="glottal"?"The vocal folds stay apart and air rushes between them: a breathy hiss shaped by the vowel around it.":`Made with ${s}: they come close enough that the air hisses through the gap.`,affricate:`Made with ${s}: a full closure that opens into a hiss.`,nasal:`Made with ${s} closed while the soft palate drops, so the sound comes out through the nose.`,lateral:`Made with ${s}, while air flows around both sides of the tongue.`,approximant:e==="\u0279"?"The tongue bunches or curls back without touching anything, lips a little rounded: the sound of an American r.":`Made with ${s} coming close but not near enough to hiss: a gliding sound.`,tap:`Made with ${s} in one very quick touch.`}[n]??s} ${l} As in "${i}".`}let r=Uo[e];if(r){let[n,o,a,i]=r,s=n>=2.5?"the jaw dropped and the mouth wide open":n>=1.5?"the mouth half open":n>=.5?"the mouth nearly closed":"the mouth almost closed",l=o<=.3?"the tongue pushed forward and high":o>=1.7?"the tongue pulled back":"the tongue relaxed in the middle";return`A vowel with ${s}, ${l}, ${a?"lips rounded":"lips relaxed or spread"}. The voice buzzes and the mouth's shape colours it. As in "${i}".`}}var Po=[["i","heed",[[342,2322],[437,2761],[452,3081]]],["\u026A","hid",[[427,2034],[483,2365],[511,2552]]],["e","hayed",[[476,2089],[536,2530],[564,2656]]],["\u025B","head",[[580,1799],[731,2058],[749,2267]]],["\xE6","had",[[588,1952],[669,2349],[717,2501]]],["\u0251","hod",[[768,1333],[936,1551],[1002,1688]]],["\u0254","hawed",[[652,997],[781,1136],[803,1210]]],["o","hoed",[[497,910],[555,1035],[597,1137]]],["\u028A","hood",[[469,1122],[519,1225],[568,1490]]],["u","who'd",[[378,997],[459,1105],[494,1345]]],["\u028C","hud",[[623,1200],[753,1426],[749,1546]]],["\u025D","heard",[[474,1379],[523,1588],[586,1719]]]];function vo(e,t,r=0){let n=i=>13*Math.atan(76e-5*i)+3.5*Math.atan((i/7500)**2),o=Math.max(0,Math.min(2,Math.round(r))),a={ipa:"\u0259",word:"about",distance:1/0};for(let[i,s,l]of Po){let[c,u]=l[o],h=Math.hypot(n(e)-n(c),.5*(n(t)-n(u)));h<a.distance&&(a={ipa:i,word:s,distance:h})}return a}function Fo(e){let t=[];for(let n of z){let o=e[n.param];if(typeof o!="number"||!Number.isFinite(o))continue;let a=n.neutral??0,i=o-a,s=n.neutral===1;if(Math.abs(i)<(s?.03:.1))continue;let l=Math.abs(i)>(s?.12:.6),c=i>0?n.high:n.low,u=l?c.includes(" ")?c.replace(" "," well "):c.endsWith("er")?"much "+c:c.endsWith("ing")?c+" a lot":"very "+c:c;t.push(`${n.subject} ${u}`)}if(t.length===0)return"A neutral mouth.";let r=t.join(", ");return r.charAt(0).toUpperCase()+r.slice(1)+"."}var _=[115,199,240];function Do(e){let t=Math.max(0,Math.min(2,Number.isFinite(e)?e:0)),r=Math.min(1,Math.floor(t)),n=t-r;return _[r]+n*(_[r+1]-_[r])}var bt=[{id:"narrator-male",name:"Narrator (male)",group:"male",description:"a steady, clear speaking voice at the male conversational mean",params:{body:0,vibratoDepth:0,drift:4,roughness:.02,breath:.12,tension:.5},speechHz:115,range:[43,64]},{id:"narrator-female",name:"Narrator (female)",group:"female",description:"a steady, clear speaking voice at the female conversational mean",params:{body:1,vibratoDepth:0,drift:4,roughness:.02,breath:.2,tension:.5},speechHz:199,range:[55,76]},{id:"child",name:"Child",group:"child",description:"a child of about ten: the smallest tract, a high light voice",params:{body:2,vibratoDepth:.1,drift:6,roughness:.02,breath:.2,tension:.5},speechHz:240,range:[57,81]},{id:"bass",name:"Bass",group:"male",description:"the lowest classical voice, E2 to E4, dark and slow to move",params:{body:0,tension:.6,breath:.1,vibratoRate:5.2,vibratoDepth:.5,glide:.2,ring:.5},speechHz:98,range:[40,64]},{id:"baritone",name:"Baritone",group:"male",description:"the middle male voice, A2 to A4",params:{body:0,tension:.58,breath:.12,vibratoRate:5.5,vibratoDepth:.45,ring:.4},speechHz:110,range:[45,69]},{id:"tenor",name:"Tenor",group:"male",description:"the high male voice, C3 to C5: a slightly shorter tract, brighter and pressed",params:{body:.15,tension:.65,breath:.1,vibratoRate:5.8,vibratoDepth:.45,ring:.6,tuning:.4},speechHz:130,range:[48,72]},{id:"contralto",name:"Contralto",group:"female",description:"the lowest female voice, F3 to F5, warm and dark",params:{body:.85,tension:.55,breath:.15,vibratoRate:5.4,vibratoDepth:.45,ring:.4},speechHz:180,range:[53,77]},{id:"mezzo",name:"Mezzo-soprano",group:"female",description:"the middle female voice, A3 to A5",params:{body:.95,tension:.58,breath:.15,vibratoRate:5.6,vibratoDepth:.5,ring:.5,tuning:.5},speechHz:195,range:[57,81]},{id:"soprano",name:"Soprano",group:"female",description:"the highest classical voice, C4 to C6, with the jaw opening on high notes as trained sopranos do",params:{body:1,tension:.62,breath:.12,vibratoRate:5.8,vibratoDepth:.55,ring:.6,tuning:1,overshoot:.12},speechHz:215,range:[60,84]},{id:"pop-female",name:"Pop (female)",group:"female",description:"light, breathy and close, little vibrato and that only on long notes",params:{body:1,tension:.45,breath:.32,vibratoRate:6,vibratoDepth:.15,vibratoDelay:.45,overshoot:.06,glide:.12},speechHz:205,range:[55,76]},{id:"pop-male",name:"Pop (male)",group:"male",description:"a light male pop voice, breathier than the classical ones, little vibrato",params:{body:.1,tension:.5,breath:.25,vibratoRate:6,vibratoDepth:.12,vibratoDelay:.45,overshoot:.06,glide:.12},speechHz:120,range:[48,69]},{id:"rock",name:"Rock (gravel)",group:"male",description:"pressed and rough, with creak at the bottom of the voice",params:{body:0,tension:.8,breath:.1,roughness:.18,fry:.35,vibratoDepth:.15,overshoot:.1},speechHz:115,range:[45,69]},{id:"elder",name:"Elder",group:"male",description:"an older man: more shimmer, a wandering pitch, a slow wide wobble",params:{body:0,tension:.4,breath:.25,roughness:.15,drift:12,vibratoRate:4.6,vibratoDepth:.5,vibratoDelay:.1},speechHz:125,range:[43,62]},{id:"beatboxer",name:"Beatboxer",group:"male",description:"a male voice on a close microphone, for beatbox(): the mic hears the air of each kick and snare",params:{body:0,mic:.8,level:.9},speechHz:115,range:[40,64]}];function Mo(e){return bt.find(t=>t.id===e)}export{Mt as a,K as b,Xt as c,Q as d,Z as e,q as f,J as g,ee as h,ye as i,Ne as j,we as k,Ie as l,Le as m,Ue as n,xe as o,Pe as p,ve as q,Fe as r,De as s,Me as t,Be as u,Ge as v,ke as w,_e as x,ze as y,We as z,Ye as A,Ve as B,je as C,Ke as D,$e as E,Qe as F,Ze as G,qe as H,Xe as I,Je as J,et as K,tt as L,Sn as M,X as N,te as O,ne as P,S as Q,rt as R,at as S,it as T,re as U,st as V,ae as W,Ho as X,St as Y,Rt as Z,yo as _,No as $,Ot as aa,Ht as ba,wo as ca,so as da,_ as ea,Do as fa,bt as ga,Mo as ha,zn as ia,pt as ja,po as ka,xo as la,vo as ma,Fo as na};
|
|
6
|
+
//# sourceMappingURL=chunk-WA623NKS.js.map
|