Announcement

Collapse
No announcement yet.

Google TTS through Chromecast

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

  • Google TTS through Chromecast

    I've been away using Home Assistant for a while and I'm thinking about coming back to Homeseer. One thing I will miss is HA's built in support for casting and Google TTS. Is there a way to use this plugin to have Google TTS play a message on one of my cast devices? IIRC, Homeseer lost support for Google TTS a while ago. Is that correct?

    I prefer Google TTS so it sounds the same as my google homes.

  • #2
    I'm also interested in this.
    RJ_Make On YouTube

    Comment


    • #3
      Same here

      Comment


      • #4
        Not sure if this is germaine to the topic, however if you have a voice installed on your windows machine, you can use the syntax below to identify a different voice in speech.

        <voice required="name=Microsoft Eva Mobile">
        RJ_Make On YouTube

        Comment


        • #5
          Is there a way to use this plugin to have Google TTS play a message on one of my cast devices?
          Unless I'm misunderstanding your question, TTS works just fine.

          I have numerous events that speak whatever I type. They play through the PC speakers and through Google Home in my kitchen perfectly.

          However, the Google Home speaks in a male voice rather than the typical female voice. I actually prefer that, since the male voice indicates it's coming from HomeSeer.

          The one thing I don't do is to cast to my chromecast devices. That would cause my receiver to stop playing whatever it's playing to make an announcement. It won't switch back and resume whatever was being watched or listened to.
          Attached Files

          Comment


          • #6
            To clarify, I'm inquiring if Google TTS works, not homeseer or windows TTS.

            Google's TTS is much better, and it sounds better if we have the same voice consistently speaking to us. I'd imagine it wouldn't be too difficult. My Home Assistant hub (running on the same hardware) is able to use Google's TTS out of the box. It is open-source, so maybe someone can check out the code.

            Comment


            • #7
              I will have a look at the Home assistant code.

              Comment


              • #8
                Originally posted by spud View Post
                I will have a look at the Home assistant code.
                Source is here:
                https://github.com/home-assistant/ho.../tts/google.py

                and it uses the Google TTS API: https://console.developers.google.co...googleapis.com

                I have 5 google homes and a couple of chromecast audios if you need any help testing.

                Comment


                • #9
                  This should be made availed to use to other speaker ( like Sonos ) if we already bought the chromecast plugin. If it is possible.

                  Like a button in chromecast plugin which incorporate this on windows or in HS3 globaly

                  Comment


                  • #10
                    I don't recall how TTS works in Homeseer, but the code I linked basically uses the Google TTS api to create an MP3 of the audio on the fly. Maybe that's how the other TTS in homeseer works, I don't know - I never used it. But since an MP3 is created, anything should be able to play the speech.

                    Comment


                    • #11
                      Originally posted by bkazm View Post
                      I don't recall how TTS works in Homeseer, but the code I linked basically uses the Google TTS api to create an MP3 of the audio on the fly. Maybe that's how the other TTS in homeseer works, I don't know - I never used it. But since an MP3 is created, anything should be able to play the speech.
                      I hope rich see this too

                      Comment


                      • #12
                        A while ago Rich posted a script to use Google TTS on Linux:
                        https://forums.homeseer.com/showthread.php?t=175012

                        but last time I tested it wasn't working anymore.
                        note that if you can make that script work, the Chromecast plugin will automatically use the Google TTS voice, because it uses speak_to_file.sh as well.

                        Comment


                        • #13
                          Originally posted by spud View Post
                          A while ago Rich posted a script to use Google TTS on Linux:
                          https://forums.homeseer.com/showthread.php?t=175012

                          but last time I tested it wasn't working anymore..
                          My vb coding is rusty, but it looks like a possible solution is here:
                          https://stackoverflow.com/questions/...ts-api-blocked

                          Basically:
                          • you must include "client" in your query string (client=t seems to work)
                          • (in case you are trying to retrieve it using AJAX) the Referer of the HTTP request must be https://translate.google.com/
                          • "tk" field changes for every query, and it must be populated with a matching hash: tk = hash(q, TKK), where q is the text to be TTSed, and TKK is a var in the global scope when you load translate.google.com: (type 'window.TKK' in the console). see the hash function at the bottom of this reply (calcHash).

                          Comment


                          • #14
                            I think this should get us going...

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

                            Comment


                            • #15
                              in version 3.0.0.19 available here, you can now use Google TTS instead of the Windows/Linux system TTS.

                              note that the messages are limited to about 200 characters, it's a bit slower than the system TTS, and since it's kind of a hack, Google could break it at anytime.

                              Click image for larger version

Name:	google_tts.png
Views:	1
Size:	64.5 KB
ID:	1196383

                              Comment

                              Working...
                              X