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

Changing pronunciation? #54

Open
JamesSeddonClaro opened this issue Apr 20, 2016 · 1 comment
Open

Changing pronunciation? #54

JamesSeddonClaro opened this issue Apr 20, 2016 · 1 comment

Comments

@JamesSeddonClaro
Copy link

I'm building a speaking calculator, so I need to change how speak.js reads the numeric function characters (+, -, *, /) to plus, minus, times and divide.

*Plus already works

@yukulele
Copy link
Contributor

you can replace it in text before read it:

var translation = {
  '+':'plus',
  '-': 'minus',
  '*': 'times',
  '/': 'divide'
}
var myTranslatedText = mytext.replace(/[-+/*]/g, (a) => ' ' + replacer[a] + ' ')
meSpeak.speak(myTranslated)

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

2 participants