Proxy that converts LaTex notation into spoken language #477
HanFarJR
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why I made it
Kokoro-FastAPI has a specific gap in their utility. They read LaTeX markup character by character rather than converting it to spoken language. When encountering math notation, the TTS engine will hear "dollar sign backslash frac open brace…" instead of "x squared plus one over two". My tts-latex-proxy solves this problem.
Kokoro-FastAPI and other TTS-engines are rendered useless for scientific notation without a preprocessing layer that converts said notation to spoken English like so:
What it does
The proxy intercepts
/v1/audio/speechrequests, processes the input text, then forwards the cleaned version to your TTS backend. All other API calls (models, health checks) pass through transparently.Before / After
$\frac{a}{b}$$E = mc^2$$\int_0^1 f(x) dx$$\alpha + \beta$$\sqrt{x^2 + y^2}$$\sum_{i=1}^{n} x_i$$P(A \cup B)$Markdown formatting (
**bold**,# Headers,[links](url), bullet lists, tables) is stripped silently.Beta Was this translation helpful? Give feedback.
All reactions