Announcement

Collapse
No announcement yet.

Script TTS Pronounciation

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

    Script TTS Pronounciation

    I have a script which speaks the outside temprature and under HS2 I used the following line to get it to say minus instread of dash for minus tempratures.
    x = Replace(x,"-","minus ")
    Under HS3 it does not work, any ideas how to get it to work under HS3
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    #2
    It looks like it should work.
    What is the text in X?
    What error messages do you get?
    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


      #3
      Originally posted by Uncle Michael View Post
      It looks like it should work.
      What is the text in X?
      What error messages do you get?
      sigpic
      A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

      Comment


        #4
        Here is the main part of the script -
        Code:
        sub main()
        	Dim a
        	Dim b
        	Dim c
        	Dim d
              Dim x
        x = Replace(x,"-","minus ") 
        hs.speak "Good "& TimeOfDay() & ".. The time is " & myTime() & "..It is" & WeekdayName(DatePart("w", Date)) & MonthName(DatePart("m", Date))& ",,the" &  myday() & "," & "and the current outside temperature is $$Dsr:408:.." & "," & "but it feels like $$Dsr:418: ..",TRUE,"Control:Livingroom"
        Dsr 408 and 418 are the temperature devices.
        sigpic
        A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

        Comment


          #5
          I think you need to assign the string to be spoken to x first, then do the replacement, then do the speaking.
          I'd expect it to look something like:
          Code:
          x = "Good "& TimeOfDay() & ".. The time is " & myTime() & "..It is" & WeekdayName(DatePart("w", Date)) & MonthName(DatePart("m", Date))& ",,the" &  myday() & "," & "and the current outside temperature is $$Dsr:408:.." & "," & "but it feels like $$Dsr:418: ..",TRUE,"Control:Livingroom"
          x = Replace(x,"-","minus ") 
          hs.speak x
          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


            #6
            Originally posted by Uncle Michael View Post
            I think you need to assign the string to be spoken to x first, then do the replacement, then do the speaking.
            I'd expect it to look something like:
            Code:
            x = "Good "& TimeOfDay() & ".. The time is " & myTime() & "..It is" & WeekdayName(DatePart("w", Date)) & MonthName(DatePart("m", Date))& ",,the" &  myday() & "," & "and the current outside temperature is $$Dsr:408:.." & "," & "but it feels like $$Dsr:418: ..",TRUE,"Control:Livingroom"
            x = Replace(x,"-","minus ") 
            hs.speak x
            Thanks for the suggestion. No that does not work, still sway's "dash" rather than "minus""
            sigpic
            A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

            Comment


              #7
              That's a puzzle. I think it's time for a simpler test.
              I'm thinking of a very short script, something like:
              Code:
              x = "This is a - test. This is a -test. This is -5 test."
              x = Replace(x,"-","minus ") 
              hs.WriteLog "sub test", x
              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


                #8
                Originally posted by Uncle Michael View Post
                That's a puzzle. I think it's time for a simpler test.
                I'm thinking of a very short script, something like:
                Code:
                x = "This is a - test. This is a -test. This is -5 test."
                x = Replace(x,"-","minus ") 
                hs.WriteLog "sub test", x
                That little script works perfectly. Found the problem when I changed the greeting script to write to log,
                Code:
                	Good Evening.. The time is 9, O7..It isSundayJanuary,,the7th,and the current outside temperature is $$Dsr:408:..,but it feels like $$Dsr:418:
                x does not know what $$Dsr:* actually is
                sigpic
                A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                Comment


                  #9
                  Originally posted by Gogs View Post
                  Found the problem when I changed the greeting script to write to log, x does not know what $$Dsr:* actually is
                  A step forward! I use writelog a lot for that very reason. Now you just have to find a way to translate the replacement variable before applying the replacement function.
                  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


                    #10
                    Originally posted by Uncle Michael View Post
                    A step forward! I use writelog a lot for that very reason. Now you just have to find a way to translate the replacement variable before applying the replacement function.
                    Hoping someone will jump in here as I have not a clue how to do it under HS3
                    sigpic
                    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                    Comment


                      #11
                      What if you substitute hs.DeviceString() for the replacement variable? Then

                      & "and the current outside temperature is $$Dsr:408:.." & ","

                      would become

                      & "and the current outside temperature is " & hs.DeviceString(408) & ","
                      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


                        #12
                        Originally posted by Uncle Michael View Post
                        What if you substitute hs.DeviceString() for the replacement variable? Then

                        & "and the current outside temperature is $$Dsr:408:.." & ","

                        would become

                        & "and the current outside temperature is " & hs.DeviceString(408) & ","
                        Thanks tried that, HS3 does not support hs.DeviceString or Value!
                        sigpic
                        A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                        Comment


                          #13
                          Originally posted by Gogs View Post
                          Thanks tried that, HS3 does not support hs.DeviceString or Value!
                          Two things
                          1. $$DSRevREF: is not the string value, it is the Device Status. $$DTRevREF: is the Device String See help.
                          2. The HS3 Device Class does support hs.DeviceString and hs.DeviceValue see help. There is not an equivalent (that I have found) to return the Device Status.
                          .
                          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #14
                            Originally posted by rprade View Post
                            Two things
                            1. $$DSRevREF: is not the string value, it is the Device Status. $$DTRevREF: is the Device String See help.
                            2. The HS3 Device Class does support hs.DeviceString and hs.DeviceValue see help. There is not an equivalent (that I have found) to return the Device Status.

                            .
                            Thanks, but $$DTR still will not reveal the value to x,
                            Jan-08 20:16:00
                            sub test Good Evening.. The time is 8,16..It isMondayJanuary,,the8th,and the current outside temperature is $$Dtr:408:..,but it feels like $$Dtr:418: ..
                            sigpic
                            A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

                            Comment


                              #15
                              Originally posted by Gogs View Post
                              Thanks tried that, HS3 does not support hs.DeviceString or Value!
                              My installation of HS3 supports both. What have you tried that leads you to think that HS3 doesn't support hs.DeviceString()?
                              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