Announcement

Collapse
No announcement yet.

Google as TTS throws an error

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

    Google as TTS throws an error

    Hi,

    In the plugin config I've chosen Google as TTS to get Norwegian language. Nothing happens when I try to run an event, and the log has this entry:

    02.11.2020 22:55:55

    Chromecast
    Error
    System.FormatException: Inndatastrengen hadde ugyldig format. ved System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) ved System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) ved System.Convert.ToInt64(String value) ved HSPI_Chromecast.GTTSToken.CalculateToken(String text, String seed) ved HSPI_Chromecast.ChromecastTarget.SpeakTextEventHandler(Objec t sender, SpeakTextEventArgs args)

    02.11.2020 22:55:55

    HomeSeer
    TTS
    Speak: (CHROMECAST:HUB PÅ KJØKKEN):Hei. Oppvaskmaskinen er ferdig

    It says something bout the input data string having the wrong format.


    Please look into this.

    regards,
    Dag-Inge

    #2
    Please try to restart the plugin and tell me if the problem persists

    Comment


      #3
      Originally posted by spud View Post
      Please try to restart the plugin and tell me if the problem persists
      No change after restart.

      Comment


        #4
        Same problem for me on HS3:

        https://forums.homeseer.com/forum/me...ormatexception
        iCore5 Win 10 Pro x64 SSD

        HS3 Pro Edition 3.0.0.435 Windows

        BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

        Comment


          #5
          Hmmm......weird. This problem seems to have come right now. Didn't do anything other than try sending a TTS this morning. I suspect it might be a Google Home API issues that fixed itself.
          iCore5 Win 10 Pro x64 SSD

          HS3 Pro Edition 3.0.0.435 Windows

          BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

          Comment


            #6
            The google voice that is used in the Chromecast plugin is based on a hack for which it needs to get a token seed from the https://translate.google.com/ page. It turns out that since very recently the html returned by this page does not always include the needed seed. I'm not sure why and it seems quite random, but other projects have been affected by the same problem: https://github.com/home-assistant/core/issues/42255

            There is another problem specific to the Chromecast plugin which is the fact that if the first Speak Action attempt fails because of the seed problem. then all subsequent Speak actions will fail too no matter what. I fixed this problem in version 4.0.16 available as a Beta version in the updater.
            So with this new version the first speak actions may still fail but once one is successfully sent it should keep working for all the subsequent ones.

            That being said, I'm worried that sooner or later Google prevent us to use this hack completely. The only alternative to that for now is to use the System voice instead of the google voice.

            Comment


              #7
              Originally posted by spud View Post
              That being said, I'm worried that sooner or later Google prevent us to use this hack completely.
              If that happens, I wanted to mention that Google allows a certain amount of free usage each month for all of their services. The amount is usually enough for a single user or for development purposes. I've never been charged for the Google cloud services I use. So, if they do cut this off, perhaps you could build in a way to allow us to enter our own API key(s) for whatever services would be required to retrieve this audio.

              Hopefully they keep this existing method working, but if not... ^^^

              HS4, Insteon, Z-wave, USB-UIRT, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, RCA HSDB2a doorbell
              Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

              Comment


                #8
                I'm getting this error with v. 4.0.16

                System.Exception: Could not get seed from https://translate.google.com/ at HSPI_Chromecast.GTTSToken.GetTokenKey() at HSPI_Chromecast.GTTSToken.CalculateToken(String text, String seed) at HSPI_Chromecast.ChromecastTarget.SpeakTextEventHandler(Objec t sender, SpeakTextEventArgs args)

                Comment


                  #9
                  Originally posted by risquare View Post
                  I'm getting this error with v. 4.0.16

                  System.Exception: Could not get seed from https://translate.google.com/ at HSPI_Chromecast.GTTSToken.GetTokenKey() at HSPI_Chromecast.GTTSToken.CalculateToken(String text, String seed) at HSPI_Chromecast.ChromecastTarget.SpeakTextEventHandler(Objec t sender, SpeakTextEventArgs args)
                  This is what I said above, this error may happen on the first few calls, but once the first TTS call start to work it should not happen again after that.

                  Comment


                    #10
                    Yes. Working now.

                    Thanks,
                    RISquare

                    Comment


                      #11
                      I'm using the Chromecast FREE that came with HS4 and I'm getting this error:

                      System.Exception: Could not get seed from https://translate.google.com/ at HSPI_Chromecast.GTTSToken.GetTokenKey() at HSPI_Chromecast.GTTSToken.CalculateToken(String text, String seed) at HSPI_Chromecast.ChromecastTarget.SpeakTextEventHandler(Objec t sender, SpeakTextEventArgs args)






                      Comment


                        #12
                        Originally posted by kellermix View Post
                        I'm using the Chromecast FREE that came with HS4 and I'm getting this error:

                        System.Exception: Could not get seed from https://translate.google.com/ at HSPI_Chromecast.GTTSToken.GetTokenKey() at HSPI_Chromecast.GTTSToken.CalculateToken(String text, String seed) at HSPI_Chromecast.ChromecastTarget.SpeakTextEventHandler(Objec t sender, SpeakTextEventArgs args)





                        Do you still get the error after a few TTS attempts?

                        Comment


                          #13
                          yes.
                          I just installed the beta version but it wants a registration.

                          Comment


                            #14
                            Originally posted by kellermix View Post
                            yes.
                            I just installed the beta version but it wants a registration.
                            I think you are confused: the free HS4 Chromecast plugin is an update of my HS3 chromecast plugin that I created on behalf of HST. So there is no point in installing the HS3 version of the plugin if you run HS4.

                            As stated in post #6 in this thread, the error you get is due to a change from google to their https://translate.google.com/ page. It was partially working until now because the change has been rolled out progressively by google, so 1 out of N times the plugin was able to access the old page. But it seems that it is no longer the case, so until I find a solution for this and release a new version with a fix, the workaround is to set the Voice setting to "System" from the "Plugins > Chromecast > Settings" page.

                            Comment


                              #15
                              Hopefully you find a solution that doesn't require this, but please consider allowing us to enter our own API key, credentials, or whatever is needed to use the official TTS API, if that is the only viable option.

                              https://cloud.google.com/text-to-speech/pricing

                              4 or 1 million characters per month is a lot of free speech. I guess the higher 4 million limit is for the lower quality voices.
                              HS4, Insteon, Z-wave, USB-UIRT, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, RCA HSDB2a doorbell
                              Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

                              Comment

                              Working...
                              X