Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mathematical equations are not spoken correctly #168

Open
hackerb9 opened this issue Mar 24, 2023 · 0 comments
Open

Mathematical equations are not spoken correctly #168

hackerb9 opened this issue Mar 24, 2023 · 0 comments

Comments

@hackerb9
Copy link

The problem

Currently, using reader-view to listen to web pages that have mathematics in them is broken. For example, here is an article which discusses the quadratic equation: https://www.quantamagazine.org/the-symmetry-that-makes-solving-math-equations-easy-20230324

That page uses \frac{-b\pm \sqrt{b^2-4ac}}{2a} as the MathML "plain source" for

$$\frac{-b\pm \sqrt{b^2-4ac}}{2a}$$

Unfortunately, depending upon your browser's MathML renderer setting, reader-view may display it as:

−b±√b2−4ac2a

And, even when it doesn't look mangled, it always comes out as gibberish when reader-view passes it to text-to-speech. Although the exact details depend on what voice is chosen, what I'm hearing from reader-view right now is:

Exclamation mark minus exclamation mark b plus minus exclamation mark root exclamation mark b two exclamation mark minus exclamation mark four a c two a

Possible solution

Fortunately, this may be a solved problem. Here is a demo of how one can convert equations into speech:

https://mathjax.github.io/MathJax-demos-web/speech-generator/convert-with-speech.html

For example, pasting in \frac{-b\pm \sqrt{b^2-4ac}}{2a}, gives us the following Clearspeak text that can be sent to TTS:

the fraction with numerator negative b plus or minus the square root of b squared minus 4 a c and denominator 2 a

Of course, that's a bit verbose, so it'd be nice if reader-view had an option to use Mathspeak instead which can be super-brief:

Frac negative b plus or minus Root b squared minus 4 a c EndRoot Over 2 a EndFrac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant