Fix Nữ ấm voice (was male-leaning), add 5 TikTok-style voices, mobile layout, phrasing marks, 160 ms syllable floor
Browse filesFiles changed (11)
- README.md+15-10
- voices/ban-hang-nu.wavAdded+3
- voices/ban-tin-nu.wavAdded+3
- voices/game-nam.wavAdded+3
- voices/ke-chuyen-nam.wavAdded+3
- voices/review-phim-nam.wavAdded+3
- voices/tra-da-nu-am.wav+2-2
- voices/voices.json+1222-198
- web/app.js+10-7
- web/index.html+52-3
- web/tts.js+2-2
25 unmodified lines2627282930313228 unmodified lines6162636465666763 unmodified lines13113213313413513613713813914014114214314425 unmodified lines| Parameters | 9.80M (8.26M text→latent + 1.54M latent→waveform decoder) || Output | 24 kHz mono || Input | Vietnamese text: numbers, dates, units and currency are normalised automatically || Voices | 4 synthetic preset voices + zero-shot cloning from a 5–15 s reference || Runtimes | PyTorch · ONNX Runtime (CPU/GPU) · ONNX Runtime Web (WebGPU, WASM fallback) || Training data | viVoice only (CC BY-NC-SA 4.0) || License | weights **CC BY-NC-SA 4.0** (non-commercial); code Apache-2.0 |28 unmodified lines````synthesize(text, voice, cfg_weight=3.0, steps=16, speed=1.0, seed=0, min_syllable_ms=160)`:- `voice`: a preset id (`tra-da-nu`, `tra-da-nu-am`, `tra-da-nam`, `tra-da-nam-tram`), a path to a reference recording, or a 192-d speaker embedding.- `cfg_weight`: text guidance. Higher is clearer; lower is looser and more natural, but makes more mistakes.- `steps`: flow-matching steps. 8 is faster and slightly rougher.- Long text is split into sentences automatically.63 unmodified lines## VoicesThe four preset voices are **synthetic**. Each is the average speaker embedding of 19–63 viVoice channels of the same gender, so none belongs to a real person.| id | Name | Pitch | Blend of | Max similarity to any single channel ||---|---|---|---|---|| `tra-da-nu` | Trà Đá · Nữ | 219 Hz | 63 channels | 0.51 || `tra-da-nu-am` | Trà Đá · Nữ ấm | 204 Hz | 19 channels | 0.50 || `tra-da-nam` | Trà Đá · Nam | 125 Hz | 55 channels | 0.59 || `tra-da-nam-tram` | Trà Đá · Nam trầm | 100 Hz | 19 channels | 0.61 |For comparison, a real speaker's own clips score 0.73 against that speaker's average (median over channels).25 unmodified lines2627282930313228 unmodified lines6162636465666763 unmodified lines13113213313413513613713813914014114214314414514614714814925 unmodified lines| Parameters | 9.80M (8.26M text→latent + 1.54M latent→waveform decoder) || Output | 24 kHz mono || Input | Vietnamese text: numbers, dates, units and currency are normalised automatically || Voices | 9 synthetic voices (4 presets + 5 TikTok-style) + zero-shot cloning from a 5–15 s reference || Runtimes | PyTorch · ONNX Runtime (CPU/GPU) · ONNX Runtime Web (WebGPU, WASM fallback) || Training data | viVoice only (CC BY-NC-SA 4.0) || License | weights **CC BY-NC-SA 4.0** (non-commercial); code Apache-2.0 |28 unmodified lines````synthesize(text, voice, cfg_weight=3.0, steps=16, speed=1.0, seed=0, min_syllable_ms=160)`:- `voice`: a voice id (`tra-da-nu`, `tra-da-nu-am`, `tra-da-nam`, `tra-da-nam-tram`, `review-phim-nam`, `ke-chuyen-nam`, `ban-tin-nu`, `game-nam`, `ban-hang-nu`), a path to a reference recording, or a 192-d speaker embedding.- `cfg_weight`: text guidance. Higher is clearer; lower is looser and more natural, but makes more mistakes.- `steps`: flow-matching steps. 8 is faster and slightly rougher.- Long text is split into sentences automatically.63 unmodified lines## VoicesAll nine voices are **synthetic**. Each is the average speaker embedding of 6–63 viVoice channels of the same gender, so none belongs to a real person. The five "TikTok style" voices blend channels of one content genre: movie reviews, mystery storytelling, news, gaming and product sales. They get the genre's timbre without copying any one creator.| id | Name | Group | Pitch | Blend of | Max similarity to any single channel ||---|---|---|---|---|---|| `tra-da-nu` | Trà Đá · Nữ | preset | 219 Hz | 63 channels | 0.46 || `tra-da-nu-am` | Trà Đá · Nữ ấm | preset | 207 Hz | 7 channels | 0.46 || `tra-da-nam` | Trà Đá · Nam | preset | 125 Hz | 55 channels | 0.57 || `tra-da-nam-tram` | Trà Đá · Nam trầm | preset | 100 Hz | 19 channels | 0.59 || `review-phim-nam` | Review phim · Nam | TikTok style | 115 Hz | 6 channels | 0.55 || `ke-chuyen-nam` | Kể chuyện · Nam trầm | TikTok style | 106 Hz | 7 channels | 0.67 || `ban-tin-nu` | Bản tin · Nữ | TikTok style | 223 Hz | 7 channels | 0.41 || `game-nam` | Game · Nam | TikTok style | 133 Hz | 6 channels | 0.55 || `ban-hang-nu` | Bán hàng · Nữ | TikTok style | 236 Hz | 6 channels | 0.50 |For comparison, a real speaker's own clips score 0.73 against that speaker's average (median over channels).
123version https://git-lfs.github.com/spec/v1oid sha256:c103a0977f8058fb3c110da258f8aeb92ce98851284499f1dce14224cbcbebbasize 212204123version https://git-lfs.github.com/spec/v1oid sha256:c64757e8a4f50d57b7dff11ebb38c94dcb912f884170b2813841817dda5ac23esize 173324123version https://git-lfs.github.com/spec/v1oid sha256:339498d389ada180b471669790227f8b03b1238f37d7b282ccc978b118ea3223size 169964123version https://git-lfs.github.com/spec/v1oid sha256:928fccf3d4e71a0e819f37fdaab07d9c181562a09a94c93b2b843a18c54631f6size 229484123version https://git-lfs.github.com/spec/v1oid sha256:7631c7c94f249f776a1bd20274b217ac8476b0cee535c31296b8821c4caf9417size 202604123version https://git-lfs.github.com/spec/v1oid sha256:6f0aa3d6e5db3bda9eec128da60e77cf1ffad04d063f02183e772cd8f9ae24cfsize 175244123version https://git-lfs.github.com/spec/v1oid sha256:7f05fdaceef069362051d15ac33f1a602ae25a45c8cb95d17fd76008ccd28065size 217964
199 unmodified lines200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409196 unmodified lines606607608609610611612196 unmodified lines809810811812813814199 unmodified lines-0.12026,0.12733,-0.20438]},{"id": "tra-da-nu-am","name": "Trà Đá · Nữ ấm","gender": "nữ","f0": 204,"description": "Giọng nữ trầm ấm, chậm rãi","blend": "trung bình 19 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","preview": "voices/tra-da-nu-am.wav","emb": [-0.67787,0.33797,0.21003,-0.17267,0.12323,-0.5247,-0.06993,0.01435,-0.18197,0.61241,-0.13201,1.27005,-0.22327,0.35093,0.44208,-0.58943,0.82421,0.19803,-0.69555,-0.26534,-0.61199,-0.21491,-0.13068,-0.90805,-0.47006,0.66419,-0.14306,0.9663,-0.5494,0.39399,-0.80909,-1.35769,-0.37856,0.65739,-0.08241,-0.5068,-0.14593,-0.1996,-0.70694,-0.05753,0.73901,-0.2474,-0.83679,-0.23372,-0.87331,-0.06687,0.68763,-0.45888,0.29276,-0.59001,0.71111,-0.1406,0.48458,0.28194,-0.28184,-0.17739,0.37073,-0.86119,-0.30661,0.60579,-0.17507,1.05638,-0.04236,-0.52738,-0.78357,0.13024,-0.36406,-0.10288,0.67103,0.04805,-0.52804,1.00599,-0.04098,0.64221,-0.9926,-0.43874,-0.0247,-0.42537,0.30395,0.28292,0.69306,0.93973,0.72723,0.27559,-0.73146,-0.72479,0.32393,0.19661,-0.44399,-0.76662,0.21329,1.19706,-0.07303,0.61641,-0.6607,-0.23297,0.22564,0.07675,0.35518,0.0896,0.48049,-0.42089,-0.09497,1.0319,-0.45897,-0.25386,0.29633,0.48809,-0.29242,-0.19427,-1.28654,0.54374,-0.08639,-0.51319,-0.21795,0.42827,-0.70943,-1.43173,0.05179,0.49066,0.51484,-1.04887,0.56862,-0.75881,-1.20702,-0.49461,-1.02445,0.14415,-0.07174,-0.75841,-0.66757,0.13715,0.04986,0.88611,-0.18849,0.47141,0.26591,-1.35672,0.11454,-0.28359,0.685,-0.27231,-0.8681,-0.41617,0.16091,0.27017,0.49936,-0.04252,-0.36281,-1.21145,-1.19104,0.19874,0.54803,0.12664,-0.06764,-0.26866,-0.75479,0.19674,0.60805,0.23368,-0.47617,-0.15022,0.28915,-1.31637,0.47953,0.34107,0.87909,-0.9279,0.00185,-0.63259,0.39449,-0.01423,0.67831,0.01425,-0.25328,-0.2312,0.0177,0.35333,-0.23839,0.0481,-0.61735,0.08532,0.12755,0.47857,-0.07349,-0.22615,-0.35037,-0.94189,-0.28226,-0.36176,-0.17342,-0.50613]},{"id": "tra-da-nam",196 unmodified lines-0.24295,0.07557,-0.14672]},{"id": "tra-da-nam-tram",196 unmodified lines-0.24789,0.38506,0.09676]}]199 unmodified lines200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411196 unmodified lines608609610611612613614615196 unmodified lines81281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838199 unmodified lines-0.12026,0.12733,-0.20438],"group": "preset"},{"id": "tra-da-nu-am","name": "Trà Đá · Nữ ấm","gender": "nữ","f0": 207,"description": "Giọng nữ trầm ấm, nhẹ nhàng","blend": "trung bình 7 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","preview": "voices/tra-da-nu-am.wav","emb": [-0.16371,0.50009,0.8913,-0.68636,0.09646,-0.20898,0.14806,0.04359,0.00927,0.34523,-0.4627,0.06762,0.50322,-0.24796,0.58164,-1.07811,0.79067,-0.12136,-0.46268,-0.90678,-0.35873,-0.48148,-0.06456,-0.7492,-0.4408,-0.07075,0.03687,0.72029,-0.3425,0.04595,-1.06693,-0.64488,-0.92199,0.09929,-0.11516,-1.27974,-0.23481,0.03981,-0.17012,-0.28736,0.40767,-1.37642,-0.34856,0.18328,-0.72645,0.2118,0.64364,-0.57182,0.086,-0.24068,-0.03242,-0.94757,0.54515,0.77326,0.03183,0.03851,0.94951,-0.44776,0.1524,0.12225,-0.93756,0.22555,-0.18256,-0.30614,-0.71359,0.12149,-0.21863,-0.21469,0.23241,0.238,-0.02398,1.08551,0.64617,-0.05306,-1.57912,-0.19296,-0.32631,-0.73966,0.80726,-0.00768,0.6403,0.13553,-0.31292,0.38967,0.02298,-0.77976,0.11643,-0.15189,-1.28486,-1.45019,0.4915,1.29855,-0.52896,0.80064,0.04832,-1.19146,-0.18946,-0.14204,0.32815,0.92309,1.15596,0.05402,0.2463,1.46289,-0.41944,0.32016,0.10867,1.07732,0.50476,-0.33538,-0.78215,0.0118,-0.05409,-0.76472,0.22942,0.20719,-1.13543,-1.59809,-0.01349,1.0532,0.233,-1.0696,0.57131,-1.26482,-0.9491,0.13709,-0.5405,0.28674,0.50192,-0.43005,-0.25742,-0.0134,-0.1778,0.37816,-0.30714,0.15668,0.97888,-1.4451,0.10728,-0.70335,0.55101,-0.65025,-1.08688,-0.20014,0.95873,0.41342,-0.01594,0.41903,0.39518,-1.35704,-1.44825,0.14403,0.55263,0.22239,0.03355,-0.90838,-0.768,-0.23086,0.50914,-0.21439,-0.44555,-0.46995,0.46908,-1.47507,0.69304,-0.1826,0.43596,-0.50768,0.26409,0.02571,0.01286,0.01961,0.76597,-0.38476,-0.05734,0.44067,-0.25481,-0.55917,-0.06382,0.42573,-0.65889,0.00455,0.01521,0.54282,0.28002,0.84507,-0.76749,-0.29062,-0.66231,-0.16101,-0.08949,-0.10668],"group": "preset"},{"id": "tra-da-nam",196 unmodified lines-0.24295,0.07557,-0.14672],"group": "preset"},{"id": "tra-da-nam-tram",196 unmodified lines-0.24789,0.38506,0.09676],"group": "preset"},{"id": "review-phim-nam","name": "Review phim · Nam","gender": "nam","f0": 115,"description": "Giọng nam trầm, kịch tính kiểu review phim","blend": "trung bình 6 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","group": "style","preview": "voices/review-phim-nam.wav","emb": [-0.90792,0.43017,0.54242,-0.89832,0.21263,-0.48661,-0.45737,-0.32565,0.36055,0.23911,-0.22183,0.27722,0.28853,0.44289,0.55798,-1.3261,1.3974,-0.08155,-0.11533,-0.19166,0.17743,-0.27311,-0.00816,-0.66798,-0.50722,-0.60565,-0.10675,0.92852,-0.60429,0.10708,-0.58985,-0.93073,-0.61912,-0.12338,-0.02649,-1.04033,-0.18332,-0.11146,0.15102,0.41673,0.61792,-0.75361,-0.35085,0.11751,-1.10854,-0.22816,0.79831,-0.49944,0.32192,-0.24578,0.55991,-0.78958,0.85662,0.58848,-0.09365,-0.14955,0.94163,-0.47792,-0.48877,0.19174,-0.91268,0.35145,0.43611,-0.41205,-0.69927,-0.16571,0.18248,-0.44724,-0.09757,0.67781,-0.03351,1.44298,0.24428,0.79936,-1.66334,-0.5633,0.25164,-0.53291,0.89518,0.75338,0.66187,0.70728,0.07868,0.61325,-0.36065,-0.73425,0.56357,-0.01903,-1.37127,-0.84776,0.15149,1.17911,-0.07704,0.53967,-0.44445,-0.43942,0.28311,-0.44566,0.1937,1.15633,0.42889,-0.68245,0.03346,1.33236,-0.79479,-0.47546,0.30139,1.32928,-0.21614,-0.6888,-0.85523,-0.40067,-1.10715,-0.63689,0.20639,0.59919,-0.95171,-0.83457,0.2307,1.26167,0.31621,-1.01743,1.05163,-1.15289,-1.53179,-0.82299,-0.72649,0.34101,-0.07156,-1.27619,-0.88092,0.31455,0.023,0.82105,-0.6989,0.57976,0.40395,-0.97899,-0.10799,-0.56826,1.15462,-0.403,-0.68648,-0.20807,0.29169,0.01554,0.44187,-0.13703,0.46578,-1.8352,-1.28993,0.01297,0.47505,-0.16964,0.09497,-0.63714,-0.49956,0.09064,0.09922,-0.02854,-0.15361,0.1187,0.84788,-1.97293,0.20688,-0.12135,0.53922,-1.14595,-0.42201,-0.22534,-0.29799,0.17711,0.7486,0.0928,0.57192,0.13379,0.11582,-0.08447,-0.21012,-0.05461,-1.09706,-0.20807,0.41201,0.59667,0.03985,0.90609,-0.46726,-0.81794,-0.68591,0.09874,0.12582,-0.07652]},{"id": "ke-chuyen-nam","name": "Kể chuyện · Nam trầm","gender": "nam","f0": 106,"description": "Giọng nam trầm, chậm, kể chuyện bí ẩn","blend": "trung bình 7 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","group": "style","preview": "voices/ke-chuyen-nam.wav","emb": [-0.16152,1.00904,0.95264,-0.92136,-0.13478,-0.08924,-0.29409,-0.1271,0.65961,0.06547,-0.33928,0.22076,0.13246,0.40722,0.18009,-1.18433,1.31211,0.157,-0.17961,-0.32823,0.03513,-0.42823,-0.5411,0.07446,-0.35607,0.27537,-0.1139,1.2671,-0.58478,0.56593,-0.94574,-0.39552,-0.13913,0.14763,-0.32212,-0.70951,-0.45918,-0.02531,-0.21356,0.92067,0.4769,-1.04599,-0.11112,0.04429,-1.06409,0.03034,0.708,-0.37707,0.80031,-0.26761,0.56612,-0.55578,1.34932,0.38075,-0.13595,-0.26275,0.66795,-0.11824,-0.3286,0.50343,-1.28325,-0.20616,0.07689,-0.14214,-0.63317,-0.42194,0.56393,-0.27362,0.30384,0.7322,0.03776,1.34604,-0.56779,0.16143,-1.59313,-0.52549,0.25132,-0.56044,0.73448,1.07712,0.78541,0.80274,0.17097,-0.13236,-0.36662,-1.09985,0.56898,0.12618,-1.05779,-0.55289,0.26996,1.02041,-0.20376,-0.0475,-0.16474,-0.89097,0.31515,-0.33673,0.0249,0.96005,0.56527,-1.02172,0.03802,1.34604,-0.88329,-1.18447,0.73171,1.38932,0.0667,-0.72432,-0.90068,-0.56401,-1.16063,0.14852,0.51869,0.21531,-0.39973,-0.53789,0.04119,1.08294,0.07872,-0.73395,0.49903,-0.97294,-1.56622,-1.25297,-0.3134,0.10764,0.4715,-1.21224,-0.1028,0.22948,0.08898,0.66093,-0.13237,0.69275,0.17314,-0.84489,0.24776,-0.43573,0.76009,-0.50562,-0.62786,-0.66194,0.88155,0.52853,0.28188,0.14516,0.39727,-1.52125,-1.28107,0.05126,0.70304,-0.04068,-0.27484,-0.1833,-0.53138,0.27418,-0.13026,-0.02944,0.10267,0.01757,0.3648,-1.42284,-0.39912,0.03652,0.85944,-0.60936,-0.13767,-0.40477,-0.27258,0.85335,0.74463,-0.20671,0.03183,-0.13831,0.38261,-0.0058,-0.44646,-0.03742,-1.89122,-0.41942,-0.11084,1.09642,0.01546,-0.28378,-0.26743,-0.32432,-0.44913,-0.18139,0.71873,-0.24583]},{"id": "ban-tin-nu","name": "Bản tin · Nữ","gender": "nữ","f0": 223,"description": "Giọng nữ rõ ràng, chuẩn như phát thanh viên","blend": "trung bình 7 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","group": "style","preview": "voices/ban-tin-nu.wav","emb": [-0.53512,0.1257,0.71878,-0.94613,-0.22445,-0.22119,-0.08809,0.29437,-0.11929,0.49939,-0.69457,0.28281,0.19846,-0.53604,0.28746,-0.84815,1.38667,-0.20155,-0.09342,-0.60126,-0.51732,-0.29252,0.20293,-0.37067,-0.40838,-0.0897,0.01356,0.88531,-0.44596,0.08282,-0.28676,-0.69379,-0.72042,-0.05448,-0.30786,-1.11963,-0.79193,0.10895,-0.2809,-0.34204,1.04518,-0.80687,-0.38006,0.06395,-0.61666,0.56141,0.4936,-0.75785,0.51265,0.38917,-0.19302,-0.67604,0.02808,0.48612,-0.00675,-0.26253,1.33764,-0.60132,0.14536,0.01915,-0.50921,0.97398,-0.45548,-0.51073,-0.55514,0.27168,-0.64305,-0.55895,0.19415,0.39642,-0.02188,0.83639,0.26268,0.38376,-1.54632,-0.26863,-0.43249,-0.93423,0.83461,-0.14682,0.49318,0.78928,-0.09671,0.73241,0.33673,0.33679,0.36723,-0.06649,-1.20048,-1.09838,0.45001,1.2427,-0.46833,0.67461,-0.06727,-1.18668,-0.05388,-0.08141,0.52973,0.50616,0.64645,-0.18206,-0.01335,0.99657,-0.45805,0.07957,0.21875,1.18362,-0.12558,-0.01167,-0.39906,0.31065,-0.23553,-0.24129,-0.01758,0.47268,-0.84669,-1.12174,0.31766,1.18301,0.27926,-0.94077,0.60012,-0.76068,-0.52584,0.18951,-0.79333,0.71781,0.17128,-0.93698,-0.53605,-0.24166,0.43941,0.34032,-0.35421,0.58351,1.05804,-1.8032,0.10882,-0.58534,0.65193,-0.34948,-1.00049,-0.42644,0.3296,0.32499,0.25595,0.22481,0.628,-1.22679,-1.29552,-0.02491,0.25913,0.11854,0.03184,-0.89455,-0.56181,-0.2494,0.62464,0.00795,-0.39307,-0.41356,0.36188,-1.29771,0.32634,-0.22679,0.74636,-0.70275,-0.2491,0.33881,0.5621,-0.56403,0.64702,-0.11479,0.2827,0.51798,-0.12352,-0.26715,-0.12755,0.53888,-0.43315,0.10758,0.2157,0.76298,0.44615,0.81119,-0.69278,-0.55998,-0.84848,-0.25881,0.07298,-0.1347]},{"id": "game-nam","name": "Game · Nam","gender": "nam","f0": 133,"description": "Giọng nam trẻ, năng động, bình luận game","blend": "trung bình 6 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","group": "style","preview": "voices/game-nam.wav","emb": [-1.13898,0.59747,0.30989,-0.29981,0.39313,-0.43925,-0.53147,-0.60477,0.49674,0.24763,-0.04867,0.93638,-0.24077,0.00195,0.37973,-0.95359,1.31889,0.34241,-0.61309,-0.73773,-0.44529,0.07415,-0.10201,-0.63027,-0.3758,0.68807,-0.59707,0.94485,-0.42027,0.55257,-1.08578,-0.90278,-1.00082,0.19321,-0.48073,-1.1015,-0.79817,-0.50755,-0.02566,0.34578,0.75301,-0.26105,-0.8637,-0.00843,-1.31614,-0.24729,0.43356,-0.41389,0.40018,-0.39268,0.90456,-0.08693,0.81295,0.50277,0.16487,-0.01797,0.75567,-0.54093,-0.26388,-0.03558,-0.68612,0.76185,0.10377,-0.42346,-0.62138,0.12442,-0.08532,-0.0918,0.57835,0.30306,-0.3194,1.45917,0.163,0.64132,-1.44075,-0.73564,-0.18933,-0.4493,0.29559,0.59511,0.63278,0.41539,-0.2473,0.4039,-0.31534,-1.05046,0.50635,0.25726,-1.02853,-0.89485,-0.26148,1.44838,0.28966,0.31433,-0.54434,-0.27879,0.3701,0.07788,0.40631,0.73618,0.52114,-0.75386,-0.26537,0.91286,-0.27669,-0.39344,0.25995,0.92548,-0.3767,0.00041,-1.21614,0.02421,-0.72168,-0.61445,0.16914,0.32558,-0.46169,-1.1415,-0.05237,0.87697,0.16949,-0.59659,0.43926,-1.07939,-1.3649,-1.10968,-0.85034,-0.16799,-0.3016,-1.27216,-0.35618,-0.15837,0.07575,0.66809,-0.37893,0.67892,0.83627,-1.3773,0.09834,-0.14827,1.02518,-0.38796,-0.87912,0.03927,0.18402,0.39193,0.29108,0.08273,-0.30506,-1.64632,-1.5603,0.08372,0.48869,0.02076,-0.08267,0.02774,-0.46659,0.20045,0.34775,-0.18666,-0.61369,-0.12012,0.16573,-1.32055,0.2411,0.26904,0.5732,-1.57128,-0.1174,-0.44983,0.11223,0.26699,0.7849,-0.47205,-0.1006,-0.14662,-0.0079,0.14065,-0.13529,-0.10018,-1.059,-0.09721,-0.04608,0.49201,-0.1394,0.27269,0.06332,-0.52161,-0.91192,-0.22247,-0.31871,-0.12266]},{"id": "ban-hang-nu","name": "Bán hàng · Nữ","gender": "nữ","f0": 236,"description": "Giọng nữ tươi, vui, giới thiệu sản phẩm","blend": "trung bình 6 kênh viVoice (giọng tổng hợp, không thuộc về người thật nào)","group": "style","preview": "voices/ban-hang-nu.wav","emb": [-0.24749,0.13216,0.22448,-0.12199,0.40632,-0.41983,0.39464,0.72385,-0.11182,0.38273,-0.79302,0.92668,-0.08255,-0.24102,0.64075,-1.03147,1.36085,0.1214,0.18145,-0.71031,-0.67052,-0.34769,0.65745,-1.3349,-0.52388,0.31039,0.03855,0.60243,-0.43305,0.10423,-0.52671,-0.91377,-0.43605,0.40146,-0.18451,-0.94311,-0.49976,0.43644,0.01192,-0.57539,0.45523,-0.90289,-0.55116,0.14287,-0.77685,1.00429,0.66612,-0.19399,0.10604,0.40099,0.13412,-0.45963,0.22746,0.72255,0.27741,0.11916,1.21627,-0.61736,0.10306,-0.26357,-0.6589,0.30948,-0.38814,-0.61694,-0.82554,0.0576,-0.76607,-0.17461,0.004,0.40639,0.01524,0.63425,0.19738,0.4298,-1.26754,0.04486,-0.25643,-0.21987,0.29981,0.02089,0.70091,0.05137,-0.39445,0.99471,-0.05769,-0.02761,0.17562,0.20135,-1.16422,-1.49723,0.30215,1.11675,0.29807,0.73227,0.01355,-1.39886,0.18699,-0.20636,0.80833,0.7668,0.63334,-0.4229,-0.15802,0.70125,-0.75982,0.50725,0.10106,0.35374,-0.47093,0.51306,-0.33701,0.45723,0.31939,-0.07351,0.06928,0.61264,-0.94274,-0.86514,0.19057,0.57295,0.43096,-0.83466,0.93402,-0.69129,-0.50691,0.7036,-0.79527,0.21429,0.28445,-1.10707,0.24812,-0.27154,0.23829,0.35213,-0.32171,0.19369,0.26812,-1.34464,-0.10332,-0.60517,0.31449,-0.73349,-1.10072,-0.82488,0.65406,0.5341,-0.16575,0.18771,0.48892,-1.39692,-1.28024,-0.12437,0.56196,0.12341,0.03959,-0.5013,-0.37714,0.17766,0.90039,-0.02569,-0.09654,-0.45662,0.46776,-1.45544,0.55837,0.22896,1.06009,-0.7901,-0.00105,0.2079,0.5548,-0.14901,0.25407,0.18235,-0.24418,1.20369,-0.15612,-0.30616,0.14415,0.56076,-0.64747,0.11101,-0.03797,0.92766,0.3499,0.50919,-0.31066,-0.67183,-0.6776,-0.25849,-0.12469,-0.17807]}]
123456789131 unmodified lines141142143144145146147148149150151152277 unmodified lines430431432433434435436import * as ort from './ort/ort.webgpu.min.mjs';import { TradaTTS, normalize, normalizePart, JOIN, isAlnum } from './tts.js?v=11202008';import { resample, kaldiFbank } from './audio.js?v=11202008';const VER = '11202008';const ROOT = new URL('..', import.meta.url).href.replace(/\/$/, ''); // repo root: config.json, onnx/, voices/const $ = id => document.getElementById(id);const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();ort.env.wasm.wasmPaths = new URL('./ort/', import.meta.url).href;131 unmodified linesreturn `<div class="voice" role="radio" tabindex="0" aria-checked="${v.id === S.sel}" data-id="${esc(v.id)}"><span class="av">${av}</span><div style="min-width:0"><div class="nm">${esc(v.name)}</div><div class="ds">${esc(ds)}</div></div><div class="acts">${acts}</div></div>`;};const mine = [...S.saved, ...(S.pending ? [S.pending] : [])];$('voices').innerHTML = S.presets.map(row).join('') + (mine.length ? `<div class="vgroup">Giọng của bạn</div>` + mine.map(row).join('') : '');$('voices').querySelectorAll('.voice').forEach(el => {const v = allVoices().find(x => x.id === el.dataset.id), pick = () => { S.sel = v.id; renderVoices(); };el.onclick = e => {const a = e.target.dataset?.a;if (a === 'play') { previewAudio?.pause(); previewAudio = new Audio(v.preview.startsWith('blob:') ? v.preview : `${ROOT}/${v.preview}`); previewAudio.play(); return; }if (a === 'del') { S.saved = S.saved.filter(x => x.id !== v.id); persist(); if (S.sel === v.id) S.sel = S.presets[0].id; renderVoices(); return; }pick();};277 unmodified lines};let gpu = false;try { gpu = !!(navigator.gpu && await navigator.gpu.requestAdapter()); } catch { gpu = false; }setPill('pBackend', gpu ? 'ok' : 'warn', gpu ? 'WebGPU' : 'CPU · WASM (không có WebGPU)');const t0 = performance.now();try {if (!gpu) throw new Error('no webgpu');12345678910131 unmodified lines142143144145146147148149150151152153154155277 unmodified lines433434435436437438439import * as ort from './ort/ort.webgpu.min.mjs';import { TradaTTS, normalize, normalizePart, JOIN, isAlnum } from './tts.js?v=11202031';import { resample, kaldiFbank } from './audio.js?v=11202031';const VER = '11202031';// model repo root (config.json, onnx/, voices/): the page's parent folder, or window.TRADA_ROOT (e.g. a Hugging Face resolve URL)const ROOT = (window.TRADA_ROOT || new URL('..', import.meta.url).href).replace(/\/$/, '');const $ = id => document.getElementById(id);const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();ort.env.wasm.wasmPaths = new URL('./ort/', import.meta.url).href;131 unmodified linesreturn `<div class="voice" role="radio" tabindex="0" aria-checked="${v.id === S.sel}" data-id="${esc(v.id)}"><span class="av">${av}</span><div style="min-width:0"><div class="nm">${esc(v.name)}</div><div class="ds">${esc(ds)}</div></div><div class="acts">${acts}</div></div>`;};const mine = [...S.saved, ...(S.pending ? [S.pending] : [])];const base = S.presets.filter(v => v.group !== 'style'), style = S.presets.filter(v => v.group === 'style');$('voices').innerHTML = base.map(row).join('') + (style.length ? `<div class="vgroup">Phong cách TikTok</div>` + style.map(row).join('') : '')+ (mine.length ? `<div class="vgroup">Giọng của bạn</div>` + mine.map(row).join('') : '');$('voices').querySelectorAll('.voice').forEach(el => {const v = allVoices().find(x => x.id === el.dataset.id), pick = () => { S.sel = v.id; renderVoices(); };el.onclick = e => {const a = e.target.dataset?.a;if (a === 'play') { previewAudio?.pause(); previewAudio = new Audio(); previewAudio.crossOrigin = 'anonymous'; previewAudio.src = v.preview.startsWith('blob:') ? v.preview : `${ROOT}/${v.preview}`; previewAudio.play(); return; }if (a === 'del') { S.saved = S.saved.filter(x => x.id !== v.id); persist(); if (S.sel === v.id) S.sel = S.presets[0].id; renderVoices(); return; }pick();};277 unmodified lines};let gpu = false;try { gpu = !!(navigator.gpu && await navigator.gpu.requestAdapter()); } catch { gpu = false; }setPill('pBackend', gpu ? 'ok' : 'warn', gpu ? 'WebGPU' : 'CPU · WASM');const t0 = performance.now();try {if (!gpu) throw new Error('no webgpu');
182 unmodified lines18318418518618718888 unmodified lines27727827928028128228328428538 unmodified lines324325326327328329182 unmodified lines.rec[aria-pressed="true"]{border-color:var(--red);color:var(--red)}footer{color:var(--muted);font-size:12.5px;display:flex;gap:16px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:16px}@media (prefers-reduced-motion:reduce){.brewing .glass .ice,.brewing .glass .stream{animation:none;opacity:1}.glass .tea{transition:none}}</style></head>88 unmodified lines<div class="wave" id="wave"><canvas id="wavecanvas" height="128"></canvas></div></div><div class="stats"><div class="stat"><b id="sDur">–</b><span>độ dài âm thanh</span></div><div class="stat"><b id="sTime">–</b><span>thời gian tạo</span></div><div class="stat"><b id="sRtf">–</b><span>nhanh hơn thời gian thực</span></div><div class="stat"><b id="sSyl">–</b><span>âm tiết</span></div></div><div class="karaoke" id="karaoke"><div class="empty">Bấm “Đọc” để nghe. Sau đó bấm vào một từ để chỉnh chỗ ngắt nghỉ trước từ đó.</div></div>38 unmodified lines<span>Các giọng mẫu là giọng tổng hợp (trộn nhiều người nói), không phải giọng của một người thật.</span></footer></div><script type="module" src="app.js?v=11202008"></script></body></html>182 unmodified lines18318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623788 unmodified lines32632732832933033133233333438 unmodified lines373374375376377378182 unmodified lines.rec[aria-pressed="true"]{border-color:var(--red);color:var(--red)}footer{color:var(--muted);font-size:12.5px;display:flex;gap:16px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:16px}/* ---- phones: editor -> voices (horizontal strip) -> result; full-width read button; no iOS zoom on inputs ---- */@media (max-width:900px){main.col{display:contents}.grid{display:flex;flex-direction:column;align-items:stretch}.grid>*{min-width:0;max-width:100%}.editor{order:1} aside.col{order:2} .loading,.result{order:3}}@media (max-width:640px){.wrap{padding-block:12px 40px;gap:14px}header{position:relative;gap:8px}.brand{padding-right:44px}.brand svg{width:38px;height:38px}.brand h1{font-size:21px}.brand p{font-size:12.5px}#theme{position:absolute;top:2px;right:0}.pills{width:100%;gap:6px}.pill{font-size:11.5px;padding:4px 9px}.editor .top{padding:12px 14px 0}.ed textarea,.ed .hl{font-size:17px;padding:4px 14px 8px}.ed textarea{min-height:120px}.legend{padding:0 14px 10px;gap:10px}.legend .note{display:none}.chips{padding:0 14px 12px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}.chips::-webkit-scrollbar{display:none}.chip{flex:none}.settings{padding:10px 14px;gap:12px 14px}.foot{padding:10px 14px;gap:8px}.go{width:100%;justify-content:center;min-height:50px;font-size:16px}.go kbd{display:none}.status{width:100%;text-align:center;font-size:12.5px}input,select{font-size:16px!important}.pad{padding:14px}aside .card .voices{flex-direction:row;overflow-x:auto;scroll-snap-type:x mandatory;gap:8px;margin:0 -14px;padding:2px 14px 6px;scrollbar-width:none}aside .card .voices::-webkit-scrollbar{display:none}.voice{flex:none;width:210px;scroll-snap-align:start}.voice .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.voices .vgroup{flex:none;writing-mode:vertical-rl;transform:rotate(180deg);margin:0;align-self:center;font-size:10.5px}.loading canvas{height:200px}.stats{grid-template-columns:repeat(4,minmax(0,1fr))}.stat{padding:8px 8px}.stat b{font-size:15px}.stat span{font-size:10.5px;line-height:1.25;display:block}.karaoke{font-size:16.5px;max-height:none}.brk{padding:10px 12px}.player{gap:10px}.play{width:44px;height:44px}.brew svg{width:110px;height:150px}footer{font-size:11.5px}}@media (prefers-reduced-motion:reduce){.brewing .glass .ice,.brewing .glass .stream{animation:none;opacity:1}.glass .tea{transition:none}}</style></head>88 unmodified lines<div class="wave" id="wave"><canvas id="wavecanvas" height="128"></canvas></div></div><div class="stats"><div class="stat"><b id="sDur">–</b><span>độ dài</span></div><div class="stat"><b id="sTime">–</b><span>thời gian tạo</span></div><div class="stat"><b id="sRtf">–</b><span>nhanh hơn thực tế</span></div><div class="stat"><b id="sSyl">–</b><span>âm tiết</span></div></div><div class="karaoke" id="karaoke"><div class="empty">Bấm “Đọc” để nghe. Sau đó bấm vào một từ để chỉnh chỗ ngắt nghỉ trước từ đó.</div></div>38 unmodified lines<span>Các giọng mẫu là giọng tổng hợp (trộn nhiều người nói), không phải giọng của một người thật.</span></footer></div><script type="module" src="app.js?v=11202031"></script></body></html>
1234567// Trà Đá TTS inference in JavaScript, backend-agnostic: pass an `ort` module (onnxruntime-web in the browser,// onnxruntime-node in tests). Mirrors trada_tts/text.py + trada_tts/infer.py.import { textNormalize } from './vi_normalize.js?v=11202008';import { fixNumbers } from './vi_fix.js?v=11202008';const TONE_MARK = { '̀': 2, '́': 3, '̉': 4, '̃': 5, '̣': 6 };const WORD_RE = /[\p{L}\p{N}_]+|[^\p{L}\p{N}_\s]/gu; // == Python re r"\w+|[^\w\s]" on NFC text1234567// Trà Đá TTS inference in JavaScript, backend-agnostic: pass an `ort` module (onnxruntime-web in the browser,// onnxruntime-node in tests). Mirrors trada_tts/text.py + trada_tts/infer.py.import { textNormalize } from './vi_normalize.js?v=11202031';import { fixNumbers } from './vi_fix.js?v=11202031';const TONE_MARK = { '̀': 2, '́': 3, '̉': 4, '̃': 5, '̣': 6 };const WORD_RE = /[\p{L}\p{N}_]+|[^\p{L}\p{N}_\s]/gu; // == Python re r"\w+|[^\w\s]" on NFC text
README.md+15-10
voices/ban-hang-nu.wavAdded+3
voices/ban-tin-nu.wavAdded+3
voices/game-nam.wavAdded+3
voices/ke-chuyen-nam.wavAdded+3
voices/review-phim-nam.wavAdded+3
voices/tra-da-nu-am.wav+2-2
voices/voices.json+1222-198
web/app.js+10-7
web/index.html+52-3
web/tts.js+2-2