Announcement

Collapse
No announcement yet.

SAPI tags and string variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SAPI tags and string variables

    Is there a way to include SAPI tags within a string variable?

    I can create script line like,
    hs.Speak("some text" <SAPI tag> "some more text")

    I can also create a line like,
    hs.Speak(string)
    where 'string' is a string variable

    What I haven't been able to figure out is how to combine SAPI control tags and string variables in the hs.Speak function. Specifically, I'd like to include pauses in the string with <silence msec="1000"/>, for example. Is it possible? How?
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    #2
    Originally posted by Uncle Michael View Post
    Is there a way to include SAPI tags within a string variable?

    I can create script line like,
    hs.Speak("some text" <SAPI tag> "some more text")

    I can also create a line like,
    hs.Speak(string)
    where 'string' is a string variable

    What I haven't been able to figure out is how to combine SAPI control tags and string variables in the hs.Speak function. Specifically, I'd like to include pauses in the string with <silence msec="1000"/>, for example. Is it possible? How?
    The quickest and simplest is to use double quotes, because a single quote is what VB thinks is the end of a string that is why it will error...there may be some class out there that can add SAPI tags but if you are happy writing them out by hand then you would do;

    hs.Speak("some text <silence msec=""1000""/> some more text")

    VB.net will interpret the double quotes as the fact that you want to put a single quote in the string. They are not processed inside HS (done in the PC speech engine).

    Comment


      #3
      Thank you. I'll give that a go.

      That did the trick.
      Last edited by Uncle Michael; March 1, 2016, 12:37 PM.
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment

      Working...
      X