Skip to content

Commit 910ee3b

Browse files
committed
Update MathCATPreferences.py
Speak PauseFactor sample at selected speed
1 parent a005c8b commit 910ee3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

NVDA-addon/addon/globalPlugins/MathCAT/MathCATPreferences.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ def OnRelativeSpeedChanged( self, event ):
250250
def OnPauseFactorChanged( self, event ):
251251
from .MathCAT import ConvertSSMLTextForNVDA
252252
from speech import speak
253+
rate = self.m_sliderRelativeSpeed.GetValue()
253254
pausefactor = self.m_sliderPauseFactor.GetValue()
254-
text = _(f"the fraction with numerator <break time='{300*pausefactor//100}ms'/> <mark name='M63i335o-4'/> <say-as interpret-as='characters'>x</say-as> to the <mark name='M63i335o-5'/> <say-as interpret-as='characters'>n</say-as> <phoneme alphabet='ipa' ph='θ'>-th</phoneme> power <break time='{128*pausefactor//100}ms'/> <mark name='M63i335o-6'/> plus <mark name='M63i335o-7'/> 1 <break time='{300*pausefactor//100}ms'/> and denominator <mark name='M63i335o-10'/> <say-as interpret-as='characters'>x</say-as> to the <mark name='M63i335o-11'/> <say-as interpret-as='characters'>n</say-as> <phoneme alphabet='ipa' ph='θ'>-th</phoneme> power <break time='{128*pausefactor//100}ms'/> <mark name='M63i335o-12'/> minus <mark name='M63i335o-13'/> 1 <break time='{600*pausefactor//100}ms'/>end fraction <break time='{150*pausefactor//100}ms'/>")
255+
text = _(f"<prosody rate='{rate}%'>the fraction with numerator <break time='{300*pausefactor//100}ms'/> <mark name='M63i335o-4'/> <say-as interpret-as='characters'>x</say-as> to the <mark name='M63i335o-5'/> <say-as interpret-as='characters'>n</say-as> <phoneme alphabet='ipa' ph='θ'>-th</phoneme> power <break time='{128*pausefactor//100}ms'/> <mark name='M63i335o-6'/> plus <mark name='M63i335o-7'/> 1 <break time='{300*pausefactor//100}ms'/> and denominator <mark name='M63i335o-10'/> <say-as interpret-as='characters'>x</say-as> to the <mark name='M63i335o-11'/> <say-as interpret-as='characters'>n</say-as> <phoneme alphabet='ipa' ph='θ'>-th</phoneme> power <break time='{128*pausefactor//100}ms'/> <mark name='M63i335o-12'/> minus <mark name='M63i335o-13'/> 1 <break time='{600*pausefactor//100}ms'/>end fraction <break time='{150*pausefactor//100}ms'/>")
255256
speak( ConvertSSMLTextForNVDA(text) )
256257

257258
def OnClickOK(self,event):

0 commit comments

Comments
 (0)