kripken/speak.js

Changing pronunciation?

JamesSeddonClaro opened this issue · 1 comments

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

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)