David,

    Inside my Sapi class I had changed the statements to an expected wait until 
done format. Where the speak statement inside the class defaults to Async mode 
which sets the wait until done. I did this to enable the purge statement to 
cancel speech during the talk for it requires both flags.

    So the other method I use for the one you want is called SpeakAsIs which if 
no flags are sent in it is spoken in the background.

    It has the format which I first posted but you have to place the flags in 
yourself, where my speak method already has the Async and Purge in them. except 
the SpeakNext does not use the purge flag.

    So in my Sapi class just use:
oTTS.SpeakAsIs text, flags

Not sending any flags and you will have what you need.

Or when you do not want to use my class then just do it as a standard format 
and instead of using SpeakAsIs text, flags just use the built in format: 
oTTS.Speak text, flags (where flags are or together, async or purge or xml)
        Bruce

  Sent: Monday, February 10, 2014 7:58 PM
  Subject: Re: Using a SAPI voice?


  Hi David,

      There is a flag to set asynchronous calls and in my SAPI class I set up 
the calls in public statements,
  Format:
  (Without Pitch)
  oTTS.Speak txt, async Or xml
  (With Pitch)
  oTTS.Speak "<pitch absmiddle=""" & CStr( getPitch) & """>" & txt & 
"</pitch>", flags

  Flags:
  Everything is and or or together in one line for the flags which are below:

  The default is sync and is 0, I don't know what your flag settings are but it 
should be the default if no flags sent.

          default_spk = 0
          sync = 0 ' Default: CONTINUOUS SPEECH!
          async = 1 ' Comes back after spoken phrase.
          purge = 2 'STOP BEFORE SPEAK only if async is used!
          isfile = 4 'OPEN TEXT AS TEXT FILE NAME AND SPEAK FILE TEXT!
          xml = 8 'USE XML TAGS!
          no_xml = 16 'IGNORE XML TAGS!
          persist = 32 'XML NEW TAGS PERSIST IN ALL SPEECH!
          punc = 64 'SAY ALL PUNCTUATIONS!

    Sent: Monday, February 10, 2014 4:33 PM
    Subject: Using a SAPI voice?


    In my app, I am using a SAPI voice, to read out a certain amount of text. 
the very basics of the code, is:

    Dim SVoice: Set SVoice = CreateObject( "SAPI.SpVoice")
    SVoice.Speak "blah-blah-blah!"

    Allright, all of this works fine. Yet, since the text is somehow lengthy, 
and I want other processes not to wait for all that text to be spoken, I have 
this one question for you experienced developers.

    Is there any instruction I can use, to send the text to the Sapi voice, and 
immediately have the next line of code carried out? That is, some kind of an 
instruction for the Sapi Object, to know that it is not supposed to wait for 
the voice to finish speaking, before the code can move on.

    Thanks for any response, and hope the above somehow made sense.




------------------------------------------------------------------------------
          This email is free from viruses and malware because avast! Antivirus 
protection is active.




---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

Reply via email to