[jawsscripts] Re: Modifying JAWS Pitch Temporarily

  • From: Doug Lee <dgl@xxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 4 Nov 2022 09:05:18 -0400

When I posted before, I accidentally assumed you were either using a script or 
using JAWS.SayString rather
than using JAWS.RunFunction to run a Say command. I really thought using 
something like this would work, but I
didn't actually construct this call for API use last time:

var string call = formatString("say(\"<pitch value=%1>raised pitch</pitch>\", 
%2, %3)",
"\"4\"",
intToString(OT_User_Requested_Information),
intToString(True)
)
jaws.RunFunction(call)

FormatString lets us use actual scripting constant names from a script; of 
course, if you're not calling this
from a script, you'll have to find and substitute the appropriate values 
yourself.

Btw, when using the JAWS API, or anything where you embed a function call in a 
string, you can't directly use
the names of JAWS constants, such as from HJConst.jsh; because they will be 
interpreted as strings and
probably translate to 0 for integer parameters and the actual string for string 
parameters. Use FormatString
in a JAWS script, with IntToString as I did; or from another language like your 
AutoHotkey case, substitute
the actual values for the constants. A JavaScript-like solution for my above 
call would then be

var call = 'say("<pitch value=4>raised pitch</pitch>", 23, -1)'

except that my earlier FormatString approach actually included "4" for the 
pitch rather than just a bare 4.

Finally, a word for the general readership about the JAWS API, because I think 
this point confuses people now
and then:

The API JAWS.SayString call is likely not exactly the same actual function as 
SayString in a JAWS
script. The API provides named function calls, but the names there don't come 
from the JAWS scripting
language; they come from a DLL manifest, which can name things differently.

On Thu, Nov 03, 2022 at 06:19:02PM -0700, timothyjb310@xxxxxxxxx wrote:
What do you mean? That looks like the same as what you posted before? 

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On
Behalf Of Doug Lee
Sent: Thursday, November 3, 2022 5:55 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Modifying JAWS Pitch Temporarily

I confess I realized that just as I was sending, wondered if a
RunFunction("say...") could do it, but didn't manage to test that theory.

On Thu, Nov 03, 2022 at 05:53:32PM -0700, timothyjb310@xxxxxxxxx wrote:
Hi, thanks for the response. I know that SAPI5 uses a similar syntax.
Unfortunately nothing I tried seemed to work based on what you posted below.
It just reads the xml rather than parsing it.

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On
Behalf Of Doug Lee
Sent: Thursday, November 3, 2022 5:27 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Modifying JAWS Pitch Temporarily

I believe something like this might help:

say("<pitch value=4>raised pitch</pitch>", OT_User_Requested_Information,
True)

The final True makes JAWS process markup. <pitch> is markup for relative
pitch change; 4 is a raise, though you can adjust to taste. Negative numbers
will decrease from baseline, and they might need to be quoted like \"this\"
(backslashes because of the quotes around the whole string).

Pardon if I got any of this wrong; I'm basing all this on work I did in
2010. :)

On Thu, Nov 03, 2022 at 04:44:31PM -0700, timothyjb310@xxxxxxxxx wrote:
Hi, so I have made some progress, however I am still struggling to get JAWS
to properly change pitch.
I dug through the default.jss file under program data/freedom
scientific/jaws/xxx/enu 

 

I saw a function to set voice settings to globals. The function called in
there is SetVoicePitch, I could not find where it was declared, or
documentation on this function, although based on how it isbeing used, it
looks like it takes some kind of cursor identifier, and a pitch identifier.
I don't know what types these are  since as I mentioned I cannot find
documentation.

 

Here is what I have so far for my auto hotkey script 

 

shift::

  jaws := ComObjCreate("freedomsci.jawsapi")

  jaws.RunFunction("SetVoicePitch (VCTX_PCCURSOR, 3)")

  jaws.RunFunction("SayString(""h"")")

  ; Can also be written as

  ; jaws.SayString("H")

  jaws.RunFunction("SetVoicePitch (VCTX_PCCURSOR, GlobalPcPitch)")

return

 

This is not working though, the function SetAllVoicesToGlobals is using
SetVoicePitch like this

 

              SetVoicePitch (VCTX_PCCURSOR, GlobalPcPitch)

              SetVoicePitch (VCTX_SAY_ALL, GlobalSayAllPitch)

              SetVoicePitch (VCTX_JAWSCURSOR, GlobalJAWSPitch)

              SetVoicePitch (VCTX_KEYBOARD, GlobalKeyboardPitch)

              SetVoicePitch (VCTX_MESSAGE, GlobalMessagePitch)

              SetVoicePitch (VCTX_MENU_AND_DIALOG, GlobalMenuDialogPitch)

 

I am making the assumption that the normal voice you here all the time would
be this VCTX_PCCURSOR reference. I tried just about all the others, and it
did not seem to make any difference. My Auto hot key script above is working
in that it does speak what ever I pass into that SayString function, and it
is not throwing an error when I am calling SetVoicePitch, however it is not
changing the pitch at all.

 

Any Ideas on this?

 

Thanks,

 

Timothy Breitenfeldt

From: timothyjb310@xxxxxxxxx <timothyjb310@xxxxxxxxx>
Sent: Sunday, October 30, 2022 8:21 PM
To: 'jawsscripts@xxxxxxxxxxxxx' <jawsscripts@xxxxxxxxxxxxx>
Subject: Modifying JAWS Pitch Temporarily

 

Hi, I am new to the list.

 

I am working on a project using auto hotkey. The project is a type of sticky
keys script for my sister to use who can only type with one hand. Basicly
basically she wants the script to make the shift key behave very similarly
to the IOS keyboard for specifically letters/numbers, where you can press
the shift key to toggle it on and off, and as soon as you press a character
key, it flips shift mode off. Built in sticky keys is not what she wants,
the only thing that is wanted is a sticky shift key.

 

I have a script that I found that mostly does this in auto hot key, however
for some reason JAWS does not read the typed capitalized letter in a hire
pitch like what would be expected. NVDA does, but I just cannot get JAWS to
identify the letter as capitalized. JAWS is reading the letter though. I
setup the auto hot key script to connect to the JAWS COM object thinking
that I could possibly use an API call to force the pitch change, although I
am not seeing that as an option. However, I can run jaws scrips through the
JAWS API. I am not familiar with JAWS scripting, and was not able to find an
answer with my own research. So, is it possible to say make a call using the
JAWS COM object API to run a function or script to change the pitch of jaws,
speak the letter using the COM API, then revert the pitch back to normal?

 

This is the best solution I have come up with to provide a seamless
experience, although I did consider two other options. The first was to just
play a sound to signify the letter was capitalized, and the second was to
just prepend the word "cap" before the letter. Neither option is ideal,
since of course a seamless user experience would be best. So is this even
possible to change the pitch using JAWS scripting?

 

Thanks,

 

Timothy Breitenfeldt


-- 
Doug Lee                 dgl@xxxxxxxx                http://www.dlee.org
"Nearly all men can stand adversity, but if you want to test a man's
character, give him power." -Abraham Lincoln
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: