Voxi Lite 1.0.0: emotion tags, payal's retrained styles (plain voices unchanged), name pronunciations, clean sentence endings
Browse filesFiles changed (8)
- CHANGELOG.md+16
- Dockerfile+2-2
- MANIFEST.json+8-8
- README.md+43-3
- config.json+1-1
- voices.safetensors+1-1
- voxi.py+93-8
- writer.safetensors+1-1
12345# Changelog## 0.5.0 (2026-11-13)- **New voices:** `varun` and `vijay` (male) and `vysh` (female), learned from Maya 2 Native's built-in synthetic123456789101112131415161718192021# Changelog## 1.0.0 (2026-11-13)First launch release (was the 0.5.1 candidate).- **Emotion tags:** call-friendly emotions as a voice (`payal@sorry`) or inline before the text they cover(`[sorry] I'm so sorry. [cheerful] Good news!`): warm, cheerful, sorry, firm, calm, plus the six base styles and`[neutral]`. A voice without styles speaks those parts plainly.- **Payal's styles retrained** (lite9 A) on real emotional speech from AI4Bharat Rasa in 11 languages (22 speakers,about 30 h, was 4). Only the style rows changed: every plain voice and every other writer weight is bit-identical to0.5.0 (checked at export).- **Names in English:** Payal as PAA-yal and Voxi as VOK-see (were guessed as PAY-ul and VAHK-see). Per-voicepronunciations: arjun says "tomorrow" with a shorter o.- **Sentence endings:** no artificial hold on the last vowel; the moment after a sentence's last word is silent (nohiss), and every rendered piece fades in and out over a few milliseconds (no clicks or cut-offs at sentence joins).`VOXI_FADE_IN` / `VOXI_FADE_OUT` set the fades.- Release check 22/22.## 0.5.0 (2026-11-13)- **New voices:** `varun` and `vijay` (male) and `vysh` (female), learned from Maya 2 Native's built-in synthetic
123456# Voxi Lite server image (CPU). Build from the release folder:# docker build -t voxi-lite:0.5.0 .# docker run --rm -p 8080:8080 -e VOXI_THREADS=4 voxi-lite:0.5.0# One model per container; scale with more containers (about 1.5 GB RAM each). Nothing is downloaded at runtime.FROM python:3.11-slim123456# Voxi Lite server image (CPU). Build from the release folder:# docker build -t voxi-lite:1.0.0 .# docker run --rm -p 8080:8080 -e VOXI_THREADS=4 voxi-lite:1.0.0# One model per container; scale with more containers (about 1.5 GB RAM each). Nothing is downloaded at runtime.FROM python:3.11-slim
12345678910111213141516155 unmodified lines172173174175176177178179180181{"name": "voxi-lite","version": "0.5.0","onnx_logmel_l1": 0.0385,"files": {".dockerignore": "254b095cf3ce7c01084350dbd03c9524ab82c6abe906dd9fabd5a86639687966","CHANGELOG.md": "2a3a18729bdcd6ee0defdaf08805bb22a536f69ac186b599efe96d13697b54c0","Dockerfile": "695d6ff865fa1606ae75c883dd02034db5d773958798b09530fd1019f28d1299","LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","NOTICE": "2fc69863a5eb219c3f46c01af6d625a56b1ea0497c0b612c43cea0ea26d8dc8b","README.md": "7b2bab3ca35104b08ecec5e9b8590e77b03ab961db3b2d76c1ec7de2a5c13f7d","banner.png": "cb4f4e38c924c943245af93d971764baa17b4e8d4d1d3c58c27f413e3e982d23","config.json": "751c6147194064150821de29634c1eef5ac0b5b01a969b31b86019ea9f737c29","decoder.safetensors": "4a5e3d638d4ee403365d05883c26745463407cb993f32b0b9929d674b956c5e2","fast/decoder.onnx": "dde72786f10785304810659fb51e007e3ac5e2708122ac8f5e3ead45b616885c","fast/exact_stft.py": "c9109e8023c3088cb328babfbd1934a3a0ca3c04f094097ac5d822d2739b7d69",155 unmodified lines"tests/latency.py": "95ca568b33f32a5352641ad10522db144d2e5a9cc975e05fa5e906e8aace8027","tests/test_server.py": "90beb58455d388aad6f33337f8af9bbd64206e5968dd4ccf175bcda358652d41","ui.html": "97ab2cea5097154832512f3d6666629be7ad13de9c8f8e99213b07454d095bbd","voices.safetensors": "033018fac83db80cbc412b3bc009a5671aeac214fe39f014c5667b6e883f12c3","voxi.py": "d0369df540393966ae223f50382bc06e330b06a47a09710d601a8ae2b21fd001","warm_phrases.json": "015fff2d4b1ef95191bb31f0d5d12e7e22b12e47aab5d45cc9c3e8bd1b479350","writer.safetensors": "ffa4dfc97e1284847bdfd4f3658308f62789b1f708829f0141b47673d86576fe","writer_arjun.safetensors": "6fa673cdace2f146f79596688f7b98a5cfd39a83b346b3ab7fe48fc7d9a94b04","writer_emo.safetensors": "b786f139a9e8b4689821aad829e21bdb345854bcd916aa32675a6809d7909f18"}12345678910111213141516155 unmodified lines172173174175176177178179180181{"name": "voxi-lite","version": "1.0.0","onnx_logmel_l1": 0.0385,"files": {".dockerignore": "254b095cf3ce7c01084350dbd03c9524ab82c6abe906dd9fabd5a86639687966","CHANGELOG.md": "4d15113e18695c0323f3482a337c99e1c71cee34b43972e1cd0d050e89a65b78","Dockerfile": "1291cc67e4f3b58ce77b9d8455e0d1636d5ea18adf90431477119d608df94d85","LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","NOTICE": "2fc69863a5eb219c3f46c01af6d625a56b1ea0497c0b612c43cea0ea26d8dc8b","README.md": "3977881d63fcd995bb44ff63f73a316337e28d9ada9d8660443f6ae10b2da068","banner.png": "cb4f4e38c924c943245af93d971764baa17b4e8d4d1d3c58c27f413e3e982d23","config.json": "9d3cb37a5d5ced0b3eeb92ab5fceeba3a2a8d1667799763e02e0b71aa8f8094c","decoder.safetensors": "4a5e3d638d4ee403365d05883c26745463407cb993f32b0b9929d674b956c5e2","fast/decoder.onnx": "dde72786f10785304810659fb51e007e3ac5e2708122ac8f5e3ead45b616885c","fast/exact_stft.py": "c9109e8023c3088cb328babfbd1934a3a0ca3c04f094097ac5d822d2739b7d69",155 unmodified lines"tests/latency.py": "95ca568b33f32a5352641ad10522db144d2e5a9cc975e05fa5e906e8aace8027","tests/test_server.py": "90beb58455d388aad6f33337f8af9bbd64206e5968dd4ccf175bcda358652d41","ui.html": "97ab2cea5097154832512f3d6666629be7ad13de9c8f8e99213b07454d095bbd","voices.safetensors": "11aebacffcdf2fcf4aeb26fccf565e9635771d264da5dcbf5a45573efc973790","voxi.py": "efd766fcfbf3cca290c03c16573c0e4019ca070e94cb94cbeefe1a16a66329bd","warm_phrases.json": "015fff2d4b1ef95191bb31f0d5d12e7e22b12e47aab5d45cc9c3e8bd1b479350","writer.safetensors": "73289e62bdc506ad240e692b96af5744816fa7707d2767e3820293cdd0b43c4c","writer_arjun.safetensors": "6fa673cdace2f146f79596688f7b98a5cfd39a83b346b3ab7fe48fc7d9a94b04","writer_emo.safetensors": "b786f139a9e8b4689821aad829e21bdb345854bcd916aa32675a6809d7909f18"}
7 unmodified lines89101112131463 unmodified lines7879808182837 unmodified lines91929394959699 unmodified lines1961971981992002012022037 unmodified lines# Voxi Lite 0.5.0CPU text-to-speech for Indian phone-agent calls, with streaming. Voxi Lite is built on[Mithi v1 Flash](https://huggingface.co/Oomni/mithi-v1-flash) (Apache-2.0) with our own fine-tuned prosody writers63 unmodified linesEach sound has several takes that rotate, so repeats do not sound identical. Unknown tags are dropped silently.Breaths are not available. The English-only voices (harper, ethan, amelia, oliver) have no sound recordings.## ListenEvery clip was made by this release on a CPU, with the default settings (24 kHz).7 unmodified linesLines: *Hindi:* नमस्ते, मैं Voxi से बोल रही हूँ। आपका बकाया ₹1,250 है, जो 15 तारीख़ तक भरना है। · *Hinglish:* Aapka order kal shaam tak deliver ho jayega, aur tracking link SMS par bhej diya hai. · *Tamil:* வணக்கம்! உங்கள் ஆர்டர் நாளை மாலைக்குள் வந்துவிடும். வேறு ஏதாவது உதவி வேண்டுமா? · *Tanglish:* Vanakkam! Unga order naalaikku varum, tracking link SMS-la anuppirukom. · *English:* Thank you for calling. Your refund of rupees 2,400 has been processed and will reach you in three to five days.### English accentsAmerican and British English voices (`lang: en` only).99 unmodified lines## Run the server```bashdocker build -t voxi-lite:0.5.0 .docker run --rm -p 8080:8080 -e VOXI_THREADS=4 -e VOXI_API_KEY=change-me voxi-lite:0.5.0# or without Docker (Python 3.11):pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txtVOXI_WARM=warm_phrases.json uvicorn server:app --host 0.0.0.0 --port 80807 unmodified lines89101112131463 unmodified lines787980818283848586878889909192939495969798991001011021037 unmodified lines11111211311411511611711811912012112212312412512612712812913013113213313413513699 unmodified lines2362372382392402412422437 unmodified lines# Voxi Lite 1.0.0CPU text-to-speech for Indian phone-agent calls, with streaming. Voxi Lite is built on[Mithi v1 Flash](https://huggingface.co/Oomni/mithi-v1-flash) (Apache-2.0) with our own fine-tuned prosody writers63 unmodified linesEach sound has several takes that rotate, so repeats do not sound identical. Unknown tags are dropped silently.Breaths are not available. The English-only voices (harper, ethan, amelia, oliver) have no sound recordings.## EmotionsUse an emotion as the voice (`"voice": "payal@sorry"`) or write it in the text before the part it covers:```textHello, this is Payal. [sorry] I'm really sorry for the delay. [cheerful] Good news, your refund is approved!```| Emotion | Plays (payal, arjun) ||---|---|| `warm` | `@happy-soft` || `cheerful` | `@happy` || `sorry` | `@sad-soft` || `firm` | `@angry-soft` || `calm`, `neutral` | the plain voice || `happy`, `sad`, `angry`, `fearful`, `surprised`, `disgusted` | that style |A tag lasts until the next tag. Voices without styles (sanjana, vishnu, varun, vijay, vysh, the English voices) readtagged parts in their plain voice.## ListenEvery clip was made by this release on a CPU, with the default settings (24 kHz).7 unmodified linesLines: *Hindi:* नमस्ते, मैं Voxi से बोल रही हूँ। आपका बकाया ₹1,250 है, जो 15 तारीख़ तक भरना है। · *Hinglish:* Aapka order kal shaam tak deliver ho jayega, aur tracking link SMS par bhej diya hai. · *Tamil:* வணக்கம்! உங்கள் ஆர்டர் நாளை மாலைக்குள் வந்துவிடும். வேறு ஏதாவது உதவி வேண்டுமா? · *Tanglish:* Vanakkam! Unga order naalaikku varum, tracking link SMS-la anuppirukom. · *English:* Thank you for calling. Your refund of rupees 2,400 has been processed and will reach you in three to five days.### Launch clips (1.0)| Clip | Text | Listen ||---|---|---|| payal · en | Hello, I'm Payal from Voxi. [cheerful] I can talk to your customers in Hindi, Tamil and English, right from a regular computer. [laughs] No GPU needed! | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/01_payal_intro_en.wav"></audio> || payal · en | [sorry] I'm so sorry about the delay with your order. Hmm, let me check that for you. [cheerful] Good news! It's out for delivery, and it will reach you by 6 PM today. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/03_payal_sorry_to_cheerful_en.wav"></audio> || payal · hi | [warm] नमस्ते! मैं पायल बोल रही हूँ। आपका फिर से स्वागत है। बताइए, मैं आपकी क्या मदद कर सकती हूँ? | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/04_payal_warm_hi.wav"></audio> || payal · hinglish | Haan ji, aapka EMI ₹4,999 har mahine ki 5 tareekh ko auto-debit hoga. [laughs] Aur koi sawaal ho toh bataiye! | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/05_payal_hinglish.wav"></audio> || arjun · en | [firm] This is a final reminder. Your payment of ₹12,500 is due by tomorrow evening. Please pay today to avoid late charges. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/06_arjun_firm_en.wav"></audio> || arjun · hi | [cheerful] बधाई हो! आपका लोन मंज़ूर हो गया है। राशि कल तक आपके खाते में आ जाएगी। | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/07_arjun_cheerful_hi.wav"></audio> || arjun · ta | வணக்கம்! உங்கள் ஆர்டர் நாளை காலை 11 மணிக்குள் டெலிவரி செய்யப்படும். நன்றி! | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/08_arjun_tamil.wav"></audio> || varun · en | Mm-hmm, got it. Your booking for tomorrow at 10 AM is confirmed. See you then! | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/09_varun_en.wav"></audio> || vysh · hi | जी बिल्कुल। आपका OTP 482913 है। कृपया इसे किसी के साथ साझा न करें। | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/10_vysh_hi.wav"></audio> || vijay · tanglish | Sir, unga payment already process aayiduchu. Refund amount ₹1,500 next week-kulla account-la credit aagum. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/11_vijay_tanglish.wav"></audio> || sanjana · ta | மன்னிக்கவும், உங்கள் கட்டணம் தோல்வியடைந்தது. தயவுசெய்து மீண்டும் முயற்சிக்கவும். | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/12_sanjana_tamil.wav"></audio> || harper · en | Thanks for calling! Your appointment is confirmed for tomorrow at 3 PM. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/13_harper_us.wav"></audio> || ethan · en | Your package has shipped, and it should arrive on Friday. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/14_ethan_us.wav"></audio> || amelia · en | Lovely to hear from you. Your refund has been processed. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/15_amelia_uk.wav"></audio> || oliver · en | Good afternoon. Your account has been updated successfully. | <audio controls preload="none" src="https://huggingface.co/IOTEverythin/voxi-lite/resolve/main/samples/launch/16_oliver_uk.wav"></audio> |### English accentsAmerican and British English voices (`lang: en` only).99 unmodified lines## Run the server```bashdocker build -t voxi-lite:1.0.0 .docker run --rm -p 8080:8080 -e VOXI_THREADS=4 -e VOXI_API_KEY=change-me voxi-lite:1.0.0# or without Docker (Python 3.11):pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txtVOXI_WARM=warm_phrases.json uvicorn server:app --host 0.0.0.0 --port 8080
123456{"name": "voxi-lite","version": "0.5.0","sample_rate": 24000,"languages": ["hi",123456{"name": "voxi-lite","version": "1.0.0","sample_rate": 24000,"languages": ["hi",
123version https://git-lfs.github.com/spec/v1oid sha256:033018fac83db80cbc412b3bc009a5671aeac214fe39f014c5667b6e883f12c3size 14366408123version https://git-lfs.github.com/spec/v1oid sha256:11aebacffcdf2fcf4aeb26fccf565e9635771d264da5dcbf5a45573efc973790size 14366408
32 unmodified lines3334353637383917 unmodified lines5758596061626313 unmodified lines77787980818223 unmodified lines106107108109110111102 unmodified lines21421521621721821957 unmodified lines2772782792802812822832842853 unmodified lines28929029129229329429529629729829931 unmodified lines331332333334335336121 unmodified lines45845946046146246346434 unmodified lines49950050150250350421 unmodified lines52652752852953053153253353453553653714 unmodified lines5525535545555565577 unmodified lines56556656756856957032 unmodified linesMAX_CHARS = 2000# Front-end fixes (2026-11-10, from the AI4Bharat benchmark failures); VOXI_FIXES="" turns them off for A/B tests# + prosody-code fixes (2026-11-12, WriterFixes): styletiming (styles on the plain voice's timing), endings (English)FIXES = {f for f in os.environ.get("VOXI_FIXES", "nasal,endpunct,chandra,styletiming,endings,sounds,en_in,pauses,sentsplit").split(",") if f}NASAL_N = re.compile(r"(̃ː?)n(?=[ʋsʃhjɾl])") # espeak hi: nasal vowel + stray n before v/s/sh/h/y/r/lEND_MARK = {"hi": "।", "ta": ".", "en": ".", "hinglish": ".", "tanglish": "."}# chandrabindu after a vowel sign or independent vowel (2026-11-11): espeak hi turns it into vowel + n (आँख -> aːnkʰ,17 unmodified lines# təmˈɑɹO, which our voices (learned from Indian English) render badly; Indian English says tʊmˈɔːɹO. Applied to the# words where American has ɑɹ and British ɒɹ (misaki's own two lexicons), names and loanwords left out.EN_IN_LEX = {"tomorrow": "tʊmˈɔːɹO", "borrow": "bˈɔːɹO", "borrower": "bˈɔːɹəwəɹ", "borrowing": "bˈɔːɹəwɪŋ","majority": "məʤˈɔːɹəti"}# Mithi's normaliser turns "10 AM" into "ten a m" and misaki reads that "a" as the article (ɐ): "ten uh-em"EN_AM = re.compile(r"(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|teen|ty|hundred|o'clock)\s+a m\b",re.I)13 unmodified linesnorm, ps = phonemes(text, lang)if lang == "en" and EN_AM.search(norm):ps = ps.replace("ɐ ˈɛm", "ˈA ˈɛm")return norm, psreturn wrapped23 unmodified linesSENT_PAUSE = float(os.environ.get("VOXI_SENT_PAUSE", "0.45"))def gap_after(ends_sentence):if ends_sentence:return max(0.15, SENT_PAUSE - 0.05) if "pauses" in FIXES else 0.15 # the closing mark adds ~50 ms itself102 unmodified linesa sentence are at most 25 ms."""VOWELS = set("aeiouæɑɐɒɔəɛɜɪʊʌAEIOUWYQ")PUNCT = set(".,!?;:—…")def __init__(self, writer, voices, vocab, style_timing=True):57 unmodified linesdef _endings(self, dec, c):d = [int(x) for x in dec]sym = [self.inv.get(x, "") for x in d]for i in range(1, len(d) - 1): # word gaps inside a sentence: at most 1 unit (25 ms)if d[i] == self.space and sym[i - 1] not in self.PUNCT and sym[i + 1] not in self.PUNCT:c[i, 0] = min(int(c[i, 0]), 1)end = len(d) - 1while end > 0 and (sym[end] in self.PUNCT or d[end] == 0):end -= 13 unmodified linesvs = [i for i in range(start, end + 1) if sym[i] in self.VOWELS]if vs:v = vs[-1]c[v, 0] = max(int(c[v, 0]), 5) # final vowel >= 125 msc[v, 2] = min(int(c[v, 2]), 1) # voiced to its endif bool((c[v, 3:8] != self.pitch_none).all()):for j in range(8, 11): # no whisper-level energy inside itc[v, j] = max(int(c[v, j]), self.sil_e + 16)for i in range(end + 1, len(d)): # closing mark and end pad: silent, unvoicedc[i, 3:8] = self.pitch_nonec[i, 8:11] = self.sil_e31 unmodified linesr"|(?<![\w'])(?P<umm>u+m+|u+h+|e+r+m+)(?![\w'-])[,.…]*"r"|(?P<hmm_hi>हम्म+्?)[,।]?|(?P<umm_hi>उम्म+्?)[,।]?", re.I)CLIP_GAP = 0.12 # silence between speech and a clip (s)class KokoroEngine:121 unmodified linesreturn self._digits_en(text), lang # phone numbers / OTPs / IDs in groups; the rest to Mithireturn text, langdef _check_voice(self, voice, lang=None):if voice not in self.voices:raise ValueError(f"unknown voice {voice!r}; have {self.voices}")if lang is not None and voice in self.english_only and lang != "en":34 unmodified linesdef synthesize(self, text, lang="hi", voice="payal", seed=None):self._check_voice(voice, lang)segs = self._sound_segments(text, voice)if segs is not None:gap = np.zeros(int(CLIP_GAP * SR), np.float32); out = []21 unmodified linesdef _checked(self, eng, text, mlang, voice, seed, retries=2):"""Render; if the audio fails audio_issue(), try again with the next seeds and keep the first good take."""base = self.tts.settings["seed"] if seed is None else seedfor k in range(retries + 1):y = np.asarray(eng.synthesize(text, lang=mlang, voice=voice, seed=base + k), np.float32)self.stats["renders"] += 1issue = audio_issue(y, text)if issue is None:return yself.stats["failed_checks"] += 1if k < retries:self.stats["retries"] += 114 unmodified linesis rendered the way stream() will chunk it."""for voice in voices or ["payal"]:self._check_voice(voice, lang)for ph in phrases:text, mlang = self.prepare(ph, lang)for chunk, _ in plan_chunks(text):7 unmodified lineswhen the first chunk is yielded). Chunks found in the cache (warm()) are used whole.chunking="sentence": one chunk per sentence."""self._check_voice(voice, lang)segs = self._sound_segments(text, voice)if segs is None:yield from self._stream_text(text, lang, voice, seed, chunking, first_max, safety, max_chunk)32 unmodified lines33343536373839404117 unmodified lines5960616263646566676869707113 unmodified lines85868788899091929323 unmodified lines117118119120121122123124125126127128129130131132133134135136137138102 unmodified lines24124224324424524624724824925025157 unmodified lines3093103113123133143153163173 unmodified lines32132232332432532632732832933033131 unmodified lines363364365366367368369370371372373374375121 unmodified lines49749849950050150250350450550650750850951051151251351451551651751851952052152252352434 unmodified lines55956056156256356456556656756856957057157257357457521 unmodified lines59759859960060160260360460560660760860914 unmodified lines6246256266276286296307 unmodified lines63863964064164264364464564664764864965065165265365465532 unmodified linesMAX_CHARS = 2000# Front-end fixes (2026-11-10, from the AI4Bharat benchmark failures); VOXI_FIXES="" turns them off for A/B tests# + prosody-code fixes (2026-11-12, WriterFixes): styletiming (styles on the plain voice's timing), endings (English)# endings since 2026-11-13: no held final vowel (owner's pick "E": it made "...due tomorrow." sound wrong), only the# silent closing mark (pick "F": removes the hiss after a sentence) and the word-gap capFIXES = {f for f in os.environ.get("VOXI_FIXES", "nasal,endpunct,chandra,styletiming,endings,sounds,en_in,pauses,sentsplit,fade").split(",") if f}NASAL_N = re.compile(r"(̃ː?)n(?=[ʋsʃhjɾl])") # espeak hi: nasal vowel + stray n before v/s/sh/h/y/r/lEND_MARK = {"hi": "।", "ta": ".", "en": ".", "hinglish": ".", "tanglish": "."}# chandrabindu after a vowel sign or independent vowel (2026-11-11): espeak hi turns it into vowel + n (आँख -> aːnkʰ,17 unmodified lines# təmˈɑɹO, which our voices (learned from Indian English) render badly; Indian English says tʊmˈɔːɹO. Applied to the# words where American has ɑɹ and British ɒɹ (misaki's own two lexicons), names and loanwords left out.EN_IN_LEX = {"tomorrow": "tʊmˈɔːɹO", "borrow": "bˈɔːɹO", "borrower": "bˈɔːɹəwəɹ", "borrowing": "bˈɔːɹəwɪŋ","majority": "məʤˈɔːɹəti",# names (2026-11-13, owner's pick "F"): misaki guessed PAY-ul and VAHK-see"payal": "pˈɑːjəl", "voxi": "vˈɒksi"}# per-voice pronunciations (phoneme string replacements), for words one voice renders badly with the shared form:# arjun's "tomorrow" with the long o sounded wrong; the owner picked the shorter o for him (2026-11-13, row "B")EN_VOICE_SUB = {"arjun": {"tʊmˈɔːɹO": "tʊmˈɔɹO"}}_CUR = __import__("threading").local() # the voice being rendered on this thread (set in VoxiLite._checked)# Mithi's normaliser turns "10 AM" into "ten a m" and misaki reads that "a" as the article (ɐ): "ten uh-em"EN_AM = re.compile(r"(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|teen|ty|hundred|o'clock)\s+a m\b",re.I)13 unmodified linesnorm, ps = phonemes(text, lang)if lang == "en" and EN_AM.search(norm):ps = ps.replace("ɐ ˈɛm", "ˈA ˈɛm")if lang == "en":for a, b in EN_VOICE_SUB.get(getattr(_CUR, "voice", None), {}).items():ps = ps.replace(a, b)return norm, psreturn wrapped23 unmodified linesSENT_PAUSE = float(os.environ.get("VOXI_SENT_PAUSE", "0.45"))FADE_IN, FADE_OUT = float(os.environ.get("VOXI_FADE_IN", "0.005")), float(os.environ.get("VOXI_FADE_OUT", "0.02"))def fade_edges(y):"""Short raised-cosine fade at both edges of a rendered piece (2026-11-13, owner: "voice cut kinda noise"): piecesare joined by digital silence, and a piece that stops at full level is heard as a cut or click. "fade" fix."""if "fade" not in FIXES or len(y) < 4 * SR // 100:return yy = y.copy()for n, sl in ((int(FADE_IN * SR), slice(None, None)), (int(FADE_OUT * SR), slice(None, None, -1))):if n > 1:w = (0.5 - 0.5 * np.cos(np.linspace(0, np.pi, n))).astype(np.float32)y[sl][:n] *= wreturn ydef gap_after(ends_sentence):if ends_sentence:return max(0.15, SENT_PAUSE - 0.05) if "pauses" in FIXES else 0.15 # the closing mark adds ~50 ms itself102 unmodified linesa sentence are at most 25 ms."""VOWELS = set("aeiouæɑɐɒɔəɛɜɪʊʌAEIOUWYQ")# 2026-11-13 (owner's picks E then F/G): no hold and no energy floor on the final vowel (the writer's own ending),# but the closing mark and end pad stay silent, which removes the hiss after a sentenceEND_MIN = 0 # final vowel at least this many 25 ms units (0 = leave the writer's length; was 5)END_FLOOR = None # energy floor in the final vowel, above the writer's silence code (None = off; was 16)GAP_CAP = 1 # word gaps inside a sentence at most this many 25 ms units (None = leave them)PUNCT = set(".,!?;:—…")def __init__(self, writer, voices, vocab, style_timing=True):57 unmodified linesdef _endings(self, dec, c):d = [int(x) for x in dec]sym = [self.inv.get(x, "") for x in d]for i in range(1, len(d) - 1 if self.GAP_CAP is not None else 1): # word gaps inside a sentence: cappedif d[i] == self.space and sym[i - 1] not in self.PUNCT and sym[i + 1] not in self.PUNCT:c[i, 0] = min(int(c[i, 0]), self.GAP_CAP)end = len(d) - 1while end > 0 and (sym[end] in self.PUNCT or d[end] == 0):end -= 13 unmodified linesvs = [i for i in range(start, end + 1) if sym[i] in self.VOWELS]if vs:v = vs[-1]c[v, 0] = max(int(c[v, 0]), self.END_MIN) # final vowel >= 125 msc[v, 2] = min(int(c[v, 2]), 1) # voiced to its endif self.END_FLOOR is not None and bool((c[v, 3:8] != self.pitch_none).all()):for j in range(8, 11): # no whisper-level energy inside itc[v, j] = max(int(c[v, j]), self.sil_e + self.END_FLOOR)for i in range(end + 1, len(d)): # closing mark and end pad: silent, unvoicedc[i, 3:8] = self.pitch_nonec[i, 8:11] = self.sil_e31 unmodified linesr"|(?<![\w'])(?P<umm>u+m+|u+h+|e+r+m+)(?![\w'-])[,.…]*"r"|(?P<hmm_hi>हम्म+्?)[,।]?|(?P<umm_hi>उम्म+्?)[,।]?", re.I)CLIP_GAP = 0.12 # silence between speech and a clip (s)# Emotion names (2026-11-13): call-friendly names mapped onto the trained styles that sound clean (the old Rasa-learned# rows; writer_emo's own styles were judged poor). Used as a voice ("payal@sorry") or inline before the text it covers# ("[sorry] I'm so sorry. [cheerful] Good news!"). None = the plain voice. A voice without that style speaks plainly.EMOTIONS = {"warm": "happy-soft", "cheerful": "happy", "sorry": "sad-soft", "firm": "angry-soft", "calm": None,"neutral": None, "normal": None, "plain": None}EMOTIONS.update({s: s for s in ("happy", "sad", "angry", "fearful", "surprised", "disgusted")})EMOTION_TAG = re.compile(r"\[\s*(" + "|".join(sorted(EMOTIONS, key=len, reverse=True)) + r")\s*\]\s*", re.I)class KokoroEngine:121 unmodified linesreturn self._digits_en(text), lang # phone numbers / OTPs / IDs in groups; the rest to Mithireturn text, langdef _resolve(self, voice):"""An emotion alias ("payal@sorry") -> the voice row that plays it ("payal@sad-soft"), or the plain voice."""base, at, st = voice.partition("@")if at and st.lower() in EMOTIONS and voice not in self.voices:row = EMOTIONS[st.lower()]name = f"{base}@{row}" if row else basereturn name if name in self.voices else basereturn voicedef _emotion_runs(self, text, voice):"""None without inline emotion tags; else [(voice, text)], each run in the voice its tag picks."""if not EMOTION_TAG.search(text):return Nonebase, runs, cur, pos = voice.split("@")[0], [], voice, 0for m in EMOTION_TAG.finditer(text):runs.append((cur, text[pos:m.start()])); pos = m.end()cur = self._resolve(f"{base}@{m.group(1).lower()}")runs.append((cur, text[pos:]))return [(v, x.strip()) for v, x in runs if re.search(r"[\w\[]", x)]def _check_voice(self, voice, lang=None):voice = self._resolve(voice)if voice not in self.voices:raise ValueError(f"unknown voice {voice!r}; have {self.voices}")if lang is not None and voice in self.english_only and lang != "en":34 unmodified linesdef synthesize(self, text, lang="hi", voice="payal", seed=None):self._check_voice(voice, lang)voice = self._resolve(voice)runs = self._emotion_runs(text, voice)if runs is not None:gap, out = np.zeros(int(gap_after(True) * SR), np.float32), []for v, x in runs:y = self._synth_one(x, lang, v, seed)out += ([gap] if out else []) + [y]return np.concatenate(out) if out else np.zeros(0, np.float32)return self._synth_one(text, lang, voice, seed)def _synth_one(self, text, lang, voice, seed):segs = self._sound_segments(text, voice)if segs is not None:gap = np.zeros(int(CLIP_GAP * SR), np.float32); out = []21 unmodified linesdef _checked(self, eng, text, mlang, voice, seed, retries=2):"""Render; if the audio fails audio_issue(), try again with the next seeds and keep the first good take."""base = self.tts.settings["seed"] if seed is None else seed_CUR.voice = voice.split("@")[0]for k in range(retries + 1):y = np.asarray(eng.synthesize(text, lang=mlang, voice=voice, seed=base + k), np.float32)self.stats["renders"] += 1issue = audio_issue(y, text)if issue is None:return fade_edges(y)self.stats["failed_checks"] += 1if k < retries:self.stats["retries"] += 114 unmodified linesis rendered the way stream() will chunk it."""for voice in voices or ["payal"]:self._check_voice(voice, lang)voice = self._resolve(voice)for ph in phrases:text, mlang = self.prepare(ph, lang)for chunk, _ in plan_chunks(text):7 unmodified lineswhen the first chunk is yielded). Chunks found in the cache (warm()) are used whole.chunking="sentence": one chunk per sentence."""self._check_voice(voice, lang)voice = self._resolve(voice)runs = self._emotion_runs(text, voice)if runs is None:yield from self._stream_one(text, lang, voice, seed, chunking, first_max, safety, max_chunk)returngap = np.zeros(int(gap_after(True) * SR), np.float32)for n, (v, x) in enumerate(runs):if n:yield gapyield from self._stream_one(x, lang, v, seed, chunking, first_max, safety, max_chunk)def _stream_one(self, text, lang, voice, seed, chunking, first_max, safety, max_chunk):segs = self._sound_segments(text, voice)if segs is None:yield from self._stream_text(text, lang, voice, seed, chunking, first_max, safety, max_chunk)
123version https://git-lfs.github.com/spec/v1oid sha256:ffa4dfc97e1284847bdfd4f3658308f62789b1f708829f0141b47673d86576fesize 75469256123version https://git-lfs.github.com/spec/v1oid sha256:73289e62bdc506ad240e692b96af5744816fa7707d2767e3820293cdd0b43c4csize 75469256
CHANGELOG.md+16
Dockerfile+2-2
MANIFEST.json+8-8
README.md+43-3
config.json+1-1
voices.safetensors+1-1
voxi.py+93-8
writer.safetensors+1-1