[jawsscripts] Re: Speaking a text with a specified voice?

  • From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 13 Feb 2013 08:10:19 +0200

Hmm, yep, it might be a good idea because accessing SAPI directly doesn't 
actually change the active voice synthesizer used by Jaws.

The possibility of stopping that voice is a must even if it is not done with 
Jaws standard keys like Control, but there is the other problem... the fact 
that if the current synthesizer is WinTalker, I will need to speak the English 
text with Eloquence.

Does anyone know if it is possible to access Eloquence directly as it is 
possible to access SAPI5?

--Octavian

----- Original Message ----- 
From: "Stefan Moisei" <vortex37@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Tuesday, February 12, 2013 10:39 PM
Subject: [jawsscripts] Re: Speaking a text with a specified voice?


>I was thinking you could use a separate synthesizer to speak the Romanian 
> messages and simply not change the jaws voice. When the Synthesizer is done 
> talking, jaws would have the same voice as before, since it was never 
> changed.
> The only problem I see with this approach is that you can't stop the speech 
> using control. There is a method to stop sapi 5 speaking, but I don't know 
> how to intercept the control key in a jaws script. KeyPressedEvent doesn't 
> seem to intercept it.
> -----Original Message----- 
> From: Octavian Rasnita
> Sent: Tuesday, February 12, 2013 10:06 AM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
> 
> Thanks Stefan, but it doesn't work because I can change the active 
> synthesizer using scripting functions, however the problem is that I don't 
> know the moment in which to do that change.
> 
> I want to do something similar to what Jaws is doing when it switches the 
> language when it encounters a text in another language, if the "detect 
> language" feature is active.
> But I want not only to change the current language of the current loaded 
> synthesizer, but to also load a new synthesizer on the fly, then when it 
> needs to speak in another language, stop the currently running synthesizer 
> in that moment and load another synthesizer.
> 
> For example, Maestro Translate does the translation using Google translating 
> service.
> When I press a hotkey to translate a text, if that translation is made from 
> English to Romanian, even if in that moment the user uses English Eloquence, 
> the translated text should be spoken in Romanian with the voice Ivona Carmen 
> for example.
> But if in the middle of speaking that romanian text the user wants to stop 
> it, he should be able to press Control or another hotkey, and then if he 
> wants to read the title of the window or a text from that window, or to hear 
> the time or do something else, he should be able to hear English Eloquence 
> as before.
> 
> Or if the user currently uses a SAPI4 synthesizer like WinTalker and 
> translates something from Romanian to English, he should hear the English 
> text spoken with English Eloquence, and after it finishes speaking that 
> text, he should hear WinTalker again.
> 
> But it seems that Jaws is not that flexible for beeing able to do that... 
> :-)
> 
> Jaws should consider somehow all the voice synthesizers as beeing a single 
> synthesizer with many voices, and should be able to change easier among 
> them.
> 
> --Octavian
> 
> ----- Original Message ----- 
> From: "Stefan Moisei" <vortex37@xxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Monday, February 11, 2013 9:32 PM
> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
> 
> 
>> Depending on your requirements, you could use sapi directly from a jaws
>> script, like so:
>>
>> var object o
>> o=CreateObject("sapi.spvoice")
>> o.Speak("test")
>> You would have to manually set the voice, rate and pitch on the object.
>> I think you can even get the available voices on the system and choose the
>> one you want. Search for "sapi.spvoice" to find out what you can do with
>> this object.
>> -----Original Message----- 
>> From: Octavian Rasnita
>> Sent: Monday, February 11, 2013 6:54 PM
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>
>> Yes of course. I used delay(5) as I shown in my first message.
>>
>> But you are right, I don't know how to find when the synthesizer finished
>> speaking so I don't know how much I need to wait.
>>
>> But actually the method is not very good, because if the text is 1 
>> kilometer
>> long and Jaws should speak it for a long time, in that period I am not 
>> able
>> to shut it down by using the Control key or in another way, but I need to
>> wait until it finishes.
>>
>> --Octavian
>>
>> ----- Original Message ----- 
>> From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Sent: Monday, February 11, 2013 4:33 PM
>> Subject: [jawsscripts] Speaking a text with a specified voice?
>>
>>
>>> Hmmm.
>>>
>>> you obviously must've also tried single/multiple pause statements between
>>> the
>>> Say (StrText)
>>> and the resetting of the voice profile, have you?
>>>
>>> like:
>>> SetActiveVoiceProfileByName ("Carmen2")
>>> SayString(sTrText)
>>> Pause ()
>>> Pause () ; varying amounts of these.
>>> SetActiveVoiceProfileByName ("Eloquence")
>>>
>>> That still doesn't really help you though probably in the need to find a
>>> function that informs jaws when the synthesizer has actually done 
>>> speaking
>>> it's assigned text. especially if your texts are never the same lengths.
>>>
>>>
>>>
>>> ----- Original Message ----- 
>>> From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>> Sent: Monday, February 11, 2013 6:36 PM
>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>
>>>
>>>>I gave the code in my first message. Here it is again:
>>>>
>>>> SetActiveVoiceProfileByName ("Carmen2")
>>>> SayString(sTrText)
>>>> SetActiveVoiceProfileByName ("Eloquence")
>>>>
>>>> The first line changes the voice to a specified voice profile, then it
>>>> should speak the message and then it should change the voice profile 
>>>> back
>>>> to Eloquence.
>>>> But the third line is executed immediately, and when it is executed, the
>>>> previously synthesizer is stopped so it doesn't speak anything.
>>>>
>>>> Thanks.
>>>>
>>>> Octavian
>>>>
>>>> --Octavian
>>>>
>>>> ----- Original Message ----- 
>>>> From: "Dang Manh Cuong" <dangmanhcuong@xxxxxxxxx>
>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>> Sent: Monday, February 11, 2013 10:22 AM
>>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>>
>>>>
>>>>> Hi
>>>>> I don't do that for a long time, but if you could send me your code, I
>>>>> think
>>>>> I could help you.
>>>>> Cuong.
>>>>> ----- Original Message ----- 
>>>>> From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
>>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>>> Sent: Sunday, February 10, 2013 11:22 PM
>>>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>>>
>>>>>
>>>>>> Thanks, but as I said, I tried in 2 ways:
>>>>>>
>>>>>> 1. SetActiveVoiceProfileByName ("Carmen2")
>>>>>>
>>>>>> 2. I also tried using SetSynth ("eloq") but it didn't help either.
>>>>>>
>>>>>> The problem is that when a new voice is activated, it shuts Jaws down
>>>>>> so
>>>>>> the
>>>>>> text spoken with the previous voice is not spoken at all.
>>>>>>
>>>>>> --Octavian
>>>>>>
>>>>>> ----- Original Message ----- 
>>>>>> From: "Dang Manh Cuong" <dangmanhcuong@xxxxxxxxx>
>>>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>>>> Sent: Sunday, February 10, 2013 3:37 PM
>>>>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>>>>
>>>>>>
>>>>>>> Hi
>>>>>>> Use SetSynth to swich to the synthesizer of choice, and use
>>>>>>> SetVoicePerson
>>>>>>> to set name.
>>>>>>> HTH
>>>>>>> Cuong
>>>>>>> ----- Original Message ----- 
>>>>>>> From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
>>>>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>>>>> Sent: Sunday, February 10, 2013 3:07 PM
>>>>>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>>>>>
>>>>>>>
>>>>>>>> Thanks Stefan and Doug. Unfortunately it seems that there is no way
>>>>>>>> to
>>>>>>>> instruct JAWS to speach a piece of text with a specified 
>>>>>>>> synthesizer,
>>>>>>>> although I was sure that this should be a simple thing.
>>>>>>>>
>>>>>>>> --Octavian
>>>>>>>>
>>>>>>>> ----- Original Message ----- 
>>>>>>>> From: "Doug Lee" <doug.lee@xxxxxxxxxxxxxxxx>
>>>>>>>> To: <jawsscripts@xxxxxxxxxxxxx>
>>>>>>>> Sent: Sunday, February 10, 2013 12:45 AM
>>>>>>>> Subject: [jawsscripts] Re: Speaking a text with a specified voice?
>>>>>>>>
>>>>>>>>
>>>>>>>>> SpeechInUse() actually tells you only whether or not speech, as
>>>>>>>>> opposed to Braille output, is being used by the JAWS user. It does
>>>>>>>>> not
>>>>>>>>> tell you when something is actually being said.
>>>>>>>>>
>>>>>>>>> On Sat, Feb 09, 2013 at 08:05:57PM +0200, Stefan Moisei wrote:
>>>>>>>>> Hi,
>>>>>>>>> The function SpeechInUse() should tell you if jaws is speaking or
>>>>>>>>> not.
>>>>>>>>>
>>>>>>>>> -----Original Message----- 
>>>>>>>>> From: Octavian Rasnita
>>>>>>>>> Sent: Saturday, February 09, 2013 5:29 PM
>>>>>>>>> To: jawsscripts@xxxxxxxxxxxxx
>>>>>>>>> Subject: [jawsscripts] Speaking a text with a specified voice?
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Is it possible to create a JAWS script that speaks a text with a
>>>>>>>>> specified
>>>>>>>>> installed voice, then after it finishes, switch back to the default
>>>>>>>>> voice?
>>>>>>>>>
>>>>>>>>> I tried:
>>>>>>>>>
>>>>>>>>> SetActiveVoiceProfileByName ("Carmen2")
>>>>>>>>> SayString(sTrText)
>>>>>>>>> SetActiveVoiceProfileByName ("Eloquence")
>>>>>>>>>
>>>>>>>>> But nothing is spoken. When the function
>>>>>>>>> SetActiveVoiceProfileByName()
>>>>>>>>> is
>>>>>>>>> called the second time, it stops immediately the speech.
>>>>>>>>>
>>>>>>>>> I have found this by doing:
>>>>>>>>>
>>>>>>>>> SetActiveVoiceProfileByName ("Carmen2")
>>>>>>>>> SayString(sTrText)
>>>>>>>>> Delay (50, TRUE )
>>>>>>>>> SetActiveVoiceProfileByName ("Eloquence")
>>>>>>>>>
>>>>>>>>> This time the text was spoken as wanted, but I wasn't able to use
>>>>>>>>> the
>>>>>>>>> computer for a few seconds after that, because of the Delay()
>>>>>>>>> function.
>>>>>>>>>
>>>>>>>>> I guess that it is not possible to calculate how much time it would
>>>>>>>>> take
>>>>>>>>> to
>>>>>>>>> speak a certain text with a specified voice, but isn't possible to
>>>>>>>>> detect
>>>>>>>>> somehow when JAWS finished speaking, in order to be able to switch
>>>>>>>>> the
>>>>>>>>> voice
>>>>>>>>> in that moment?
>>>>>>>>>
>>>>>>>>> I also tried using SetSynth ("eloq") but it didn't help either.
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --Octavian
>>>>>>>>>
>>>>>>>>> __________???
>>>>>>>>>
>>>>>>>>> View the list's information and change your settings at
>>>>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>>>>
>>>>>>>>> __________???
>>>>>>>>>
>>>>>>>>> View the list's information and change your settings at
>>>>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>>> Doug Lee, Senior Accessibility Programmer
>>>>>>>>> SSB BART Group - Accessibility-on-Demand
>>>>>>>>> mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
>>>>>>>>> "While they were saying among themselves it cannot be done,
>>>>>>>>> it was done." --Helen Keller
>>>>>>>>> __________�
>>>>>>>>>
>>>>>>>>> View the list's information and change your settings at
>>>>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>>>>
>>>>>>>>
>>>>>>>> __________�
>>>>>>>>
>>>>>>>> View the list's information and change your settings at
>>>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>>>
>>>>>>> ________________ Dang Manh Cuong HCMC University of Pedagogy: The
>>>>>>> Educational Psychology Mobile: +84 902-572-300 E-mail:
>>>>>>> dangmanhcuong@xxxxxxxxx Yahoo! ID: manhcuong0312 Skype name:
>>>>>>> dangmanhcuong
>>>>>>> facebook:
>>>>>>>
>>>>>>> __________�
>>>>>>>
>>>>>>> View the list's information and change your settings at
>>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>>
>>>>>>
>>>>>> __________�
>>>>>>
>>>>>> View the list's information and change your settings at
>>>>>> //www.freelists.org/list/jawsscripts
>>>>>>
>>>>> ________________ Dang Manh Cuong HCMC University of Pedagogy: The
>>>>> Educational Psychology Mobile: +84 902-572-300 E-mail:
>>>>> dangmanhcuong@xxxxxxxxx Yahoo! ID: manhcuong0312 Skype name:
>>>>> dangmanhcuong
>>>>> facebook:
>>>>>
>>>>> __________�
>>>>>
>>>>> View the list's information and change your settings at
>>>>> //www.freelists.org/list/jawsscripts
>>>>>
>>>> __________�
>>>>
>>>> View the list's information and change your settings at
>>>> //www.freelists.org/list/jawsscripts
>>>>
>>>>
>>>
>>> __________�
>>>
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/jawsscripts
>>>
>>
>> __________�
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>> __________�
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
> __________�
> 
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
> 
> __________�
> 
> View the list's information and change your settings at 
> //www.freelists.org/list/jawsscripts
>
__________�

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

Other related posts: