Download nvdajp-client-130223.zip
if speech engine is speaking, nvdaController_isSpeaking() returns True.
# coding: utf-8 import time import ctypes DLLPATH = '../newclient/nvdaHelper/build/x86/client/nvdaControllerClient32.dll' clientLib=ctypes.windll.LoadLibrary(DLLPATH) res=clientLib.nvdaController_testIfRunning() if res!=0: errorMessage=str(ctypes.WinError(res)) ctypes.windll.user32.MessageBoxW(0,u"Error: %s"%errorMessage,u"Error communicating with NVDA",0) exit(1) clientLib.nvdaController_speakText( u"This is test case.\n \ The case nvdaController_isSpeaking beep out when speaking with nvda! \ ") while True: time.sleep(0.5) ctypes.windll.user32.MessageBeep(0) if not clientLib.nvdaController_isSpeaking(): break ctypes.windll.user32.MessageBeep(1) clientLib.nvdaController_cancelSpeech() clientLib.nvdaController_speakText(u"Finished!")
Pitch can be manipulated by nvdaController_getPitch() and nvdaController_setPitch() methods.
# coding: utf-8
import time
import ctypes
DLLPATH = '../newclient/nvdaHelper/build/x86/client/nvdaControllerClient32.dll'
clientLib=ctypes.windll.LoadLibrary(DLLPATH)
res=clientLib.nvdaController_testIfRunning()
if res!=0:
errorMessage=str(ctypes.WinError(res))
ctypes.windll.user32.MessageBoxW(0,u"Error: %s"%errorMessage,u"Error communicating with NVDA",0)
exit(1)
oldPitch = clientLib.nvdaController_getPitch()
clientLib.nvdaController_speakText("current pitch is %s . now changes pitch"%oldPitch)
time.sleep(5)
clientLib.nvdaController_setPitch(oldPitch-50)
newPitch = clientLib.nvdaController_getPitch()
clientLib.nvdaController_speakText("pitch changed to %s"%newPitch)
time.sleep(5)
clientLib.nvdaController_setPitch(oldPitch+50)
newPitch = clientLib.nvdaController_getPitch()
clientLib.nvdaController_speakText("pitch changed to %s"%newPitch)
time.sleep(5)
clientLib.nvdaController_setPitch(oldPitch)
clientLib.nvdaController_speakText("pitch reverted to %s"%oldPitch)
Rate (speed) can be manipulated by nvdaController_getRate() and nvdaController_setRate() methods.
# coding: utf-8
import time
import ctypes
DLLPATH = '../newclient/nvdaHelper/build/x86/client/nvdaControllerClient32.dll'
clientLib=ctypes.windll.LoadLibrary(DLLPATH)
res=clientLib.nvdaController_testIfRunning()
if res!=0:
errorMessage=str(ctypes.WinError(res))
ctypes.windll.user32.MessageBoxW(0,u"Error: %s"%errorMessage,u"Error communicating with NVDA",0)
exit(1)
oldRate = clientLib.nvdaController_getRate()
clientLib.nvdaController_speakText("Rate is %s . now changes"%oldRate)
time.sleep(5)
clientLib.nvdaController_setRate(oldRate-50)
newRate = clientLib.nvdaController_getRate()
clientLib.nvdaController_speakText("Rate changed to %s"%newRate)
time.sleep(5)
clientLib.nvdaController_setRate(oldRate+50)
newRate = clientLib.nvdaController_getRate()
clientLib.nvdaController_speakText("Rate changed to %s"%newRate)
time.sleep(5)
clientLib.nvdaController_setRate(oldRate)
clientLib.nvdaController_speakText("Rate reverted to %s"%oldRate)
Text can be announced using character descriptions via nvdaController_speakSpelling() method.
import time import ctypes DLLPATH = '../newClient/nvdaHelper/build/x86/client/nvdaControllerClient32.dll' clientLib=ctypes.windll.LoadLibrary(DLLPATH) res=clientLib.nvdaController_testIfRunning() if res!=0: errorMessage=str(ctypes.WinError(res)) ctypes.windll.user32.MessageBoxW(0,u"Error: %s"%errorMessage,u"Error communicating with NVDA",0) for count in xrange(4): clientLib.nvdaController_speakSpelling(u"カタカナ ひらがな") time.sleep(5)