Announcement

Collapse
No announcement yet.

Caching Speech routines using Amazon Polly

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

    #46
    What type of system, OS are you running?

    That is the very last step it is failing on, did everything else run before that?

    Comment


      #47
      Ah yes. I forgot to mention that. I have the HomeTroller-SEL running Linux (14.04.1 LTS) HomeSeer version 3.0.0.484. I know you wrote this for Rasberry Pi, but hoping it wouldn't make a difference.

      Comment


        #48
        The error you're reporting is a bit of a mystery. The PollyC.keys file is generated by the steps between the line that prints "Creating key file" and the chmod command. No error messages, but apparently it isn't created...

        Troubleshooting ideas... post results of these commands

        1) show the version of make
        Code:
        make -v
        2) Check if package installs were successful
        Code:
        dpkg -V python-pip python3-pip mpg123 flite libttspico-utils
        pip list
        pip3 list
        Note: "dpkg -V" cmd only prints if packages are missing, so no output is good. For "pip" cmds, looking for presence of "boto3" package.

        3) Check if scripts were installed
        Code:
        ls -ld /usr/local/HomeSeer/PollyC* /usr/local/HomeSeer/speak*
        4) make -n
        Code:
        make -n install-pollyc
        Last edited by zwolfpack; January 21, 2019, 10:43 AM. Reason: Correct case of "PollyC" in command

        Comment


          #49
          Wolf,

          Why don't we talk about PollyC offline on Sunday. Send me an offline message about what could be a good time for you.

          Python is not really my bag, I'm basically a hack with it, and there are a couple of thing that should be added. We can also put it up on GitHub so it's generally available to everyone including HomeSeer. I think HS would be way ahead if they added it to HS3 and created a Polly Gateway on MyHS. With the Caching there would be very little cost to HS as very little traffic would actually pass through the gateway to Amazon Polly.
          HomeSeer Version: HS3 Standard Edition 3.0.0.548
          Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
          Number of Devices: 484 | Number of Events: 776

          Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
          3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
          4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
          3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

          Z-Net version: 1.0.23 for Inclusion Nodes
          SmartStick+: 6.04 (ZDK 6.81.3) on Server

          Comment


            #50
            Wolf,
            Below is the output to the commands you had me run. Thank you! Sorry it took a few days, work has been extremely busy lately....plus young kids.


            1) Make -v
            Code:
            GNU Make 3.81
            Copyright (C) 2006  Free Software Foundation, Inc.
            This is free software; see the source for copying conditions.
            There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
            PARTICULAR PURPOSE.
            
            This program built for i686-pc-linux-gnu

            2) dpkg -V python-pip python3-pip mpg123 flite libttspico-utils
            no output

            2a) pip list

            Code:
            apt-xapian-index (0.45)
            argparse (1.2.1)
            boto3 (1.9.25)
            botocore (1.12.25)
            chardet (2.0.1)
            colorama (0.2.5)
            defer (1.0.6)
            docutils (0.14)
            futures (3.2.0)
            html5lib (0.999)
            jmespath (0.9.3)
            pip (1.5.4)
            psutil (1.2.1)
            pycrypto (2.6.1)
            pycups (1.9.66)
            pycurl (7.19.3)
            pygobject (3.12.0)
            pysmbc (1.0.14.1)
            pysqlite (2.6.3)
            python-apt (0.9.3.5)
            python-dateutil (2.7.3)
            python-debian (0.1.21-nmu2ubuntu2)
            pyxdg (0.25)
            requests (2.2.1)
            s3transfer (0.1.13)
            setuptools (3.3)
            six (1.5.2)
            ssh-import-id (3.21)
            urllib3 (1.23)
            wsgiref (0.1.2)
            2b) pip3 list

            Code:
            apturl (0.5.2ubuntu4)
            boto3 (1.9.25)
            botocore (1.12.25)
            chardet (2.0.1)
            colorama (0.2.5)
            command-not-found (0.3)
            defer (1.0.6)
            docutils (0.14)
            html5lib (0.999)
            jmespath (0.9.3)
            language-selector (0.1)
            pip (1.5.4)
            pycurl (7.19.3)
            pygobject (3.12.0)
            python-apt (0.9.3.5)
            python-dateutil (2.7.3)
            python-debian (0.1.21-nmu2ubuntu2)
            requests (2.2.1)
            s3transfer (0.1.13)
            setuptools (3.3)
            six (1.5.2)
            ubuntu-drivers-common (0.0.0)
            ufw (0.34-rc-0ubuntu2)
            unattended-upgrades (0.1)
            urllib3 (1.23)
            usb-creator (0.2.23)
            xkit (0.0.0)
            3) ls -ld /usr/local/HomeSeer/PollyC* /usr/local/HomeSeer/speak*

            Code:
            drwxrwxr-x 2 homeseer homeseer 4096 Jan 16 15:16 /usr/local/HomeSeer/PollyC
            -rw-rw-r-- 1 homeseer homeseer 8616 Jan 16 13:20 /usr/local/HomeSeer/PollyC-installer.zip
            -rwxr-xr-x 1 root     root     7206 Sep 25 23:00 /usr/local/HomeSeer/PollyC.py
            -rwxr-xr-x 1 root     root     7218 Sep 25 22:54 /usr/local/HomeSeer/PollyC.py3
            -rwxr-xr-x 1 root     root     1153 Sep 28 12:38 /usr/local/HomeSeer/speak.sh
            -rwxr-xr-x 1 homeseer homeseer   81 Jul 11  2018 /usr/local/HomeSeer/speak.sh.BACKUP
            -rw-rw-r-- 1 homeseer homeseer  205 Sep 29 09:04 /usr/local/HomeSeer/speak.sh.polly_BACKUP
            -rwxr-xr-x 1 root     root     1301 Sep 28 12:38 /usr/local/HomeSeer/speak_to_file.sh
            -rwxr-xr-x 1 homeseer homeseer   32 Jan  1  2017 /usr/local/HomeSeer/speak_to_file.sh.BACKUP
            -rw-rw-r-- 1 homeseer homeseer  216 Oct 16 17:44 /usr/local/HomeSeer/speak_to_file.sh.PollyBACKUP
            4) make -n install-pollyc

            Code:
            test 1000 -eq 0 || (echo "Super-user access required - please use 'sudo'." && exit 1)
            apt-get -qy install python-pip python3-pip
            pip install boto3
            pip3 install boto3
            apt-get -qy install mpg123
            apt-get -qy install flite
            apt-get -qy install libttspico-utils
            install -p PollyC.py PollyC.py3 speak.sh speak_to_file.sh /usr/local/HomeSeer
            echo "Creating key file..."
            chmod 600 /usr/local/HomeSeer/PollyC.keys

            Comment


              #51
              Ranger

              Looks like everything ran correctly,except for the final step of the key file generation. If I had to guess, I'd suspect your version of make (Copyright (C) 2006) is a little long-in-the-tooth and isn't doing the file writes properly.

              To create the file manually, use a text editor to create /usr/local/HomeSeer/PollyC.keys (case-sensitive) and paste in this content

              Code:
              # PollyC configurable parameters read by speak.sh, speak_to_file.sh
              keyid="your_keyid"
              accesskey="your_accesskey"
              region="us-west-1"
              voice="Joanna"
              cachedir="PollyCache"
              keyid and accesskey are acquired when you register with Amazon.
              voice - I believe Joanna is the voice of Alexa. I'm partial to Amy (British).
              region: https://docs.aws.amazon.com/general/...tml#pol_region

              Comment


                #52
                Just wanted to let everyone know that PollyC will be released on GitHub. Wolfs changes will be included along with a couple more he's making that I planned to do but hadn't got around to yet.

                One of those changes will allow you to select which voice to use when you speak a phrase. This way you can use more than one voice. This could be use so that one voice speaks simple alerts and the other voice for major alerts. Normally this would be a female for one and a male for the other. It would also allow for dual language as Polly can speak in multiple languages.

                -----

                I believe it's possible to do apt-get from a GitHub repository but I'm not sure. That would make installation on Linux boxes much easier. If anyone has information on this please let us know.

                -----

                Does anyone know if it's possible to change the speech output handlers on the Windows version of HS3? It would be nice if they could have the benefit of the super clear voice quality of Polly.

                -----

                I would love to see it possible for everyone to use Polly without having to create their own AWS account. It's totally doable but there is one catch. Someone has to fund the AWS account that would handle it.

                Basically something similar to how MyHS is done with it's interface to Alexa. PollyC would still look in its local cache to see if it's spoken the phrase before and if not it would make a call to the AWS site. That site could also have a cache and check if the phrase is in it. If not then a call to Polly would be made and the speech file returned. The economy of scale would be suck that the cost would be minimal due to all of the caching involved but these is a cost.

                HomeSeer Version: HS3 Standard Edition 3.0.0.548
                Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                Number of Devices: 484 | Number of Events: 776

                Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                Z-Net version: 1.0.23 for Inclusion Nodes
                SmartStick+: 6.04 (ZDK 6.81.3) on Server

                Comment


                  #53
                  zwolfpack

                  Just wanted to let you know that manually editing the keys file worked. Thank you for your help. Also, on behalf of the HomeSeer community, thank you and Timon for putting this installer out there for everyone. The default Linux voices are painfully robotic. This is a huge upgrade.

                  Comment


                    #54
                    Ranger - thanks for the feedback. Good to know it can work on other platforms!

                    Comment


                      #55
                      Is this available on github ?
                      Want to make some changes to it.

                      Comment


                        #56
                        Sorry, not yet. I've been busy so several other things and haven't got there yet.
                        HomeSeer Version: HS3 Standard Edition 3.0.0.548
                        Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                        Number of Devices: 484 | Number of Events: 776

                        Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                        3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                        4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                        3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                        Z-Net version: 1.0.23 for Inclusion Nodes
                        SmartStick+: 6.04 (ZDK 6.81.3) on Server

                        Comment


                          #57
                          I've updated post #37...

                          - new capability: prepending text with <voice-id="voice"> selects voice for the message.
                          - new capability: prepending text with <no-cache> prevents that message from being cached. Useful for dynamic messages not likely to be reused.
                          - additional MPEG packages (ffmpeg and/or avtools) are installed if available. For Chromecast support.

                          Comment


                            #58
                            To use this , I was in the need to use airplayspeak. It works since almost 6 months.

                            But I would like to make this work with the squeezebox plugin ( so I could remove shairpoet sunc from my raspberry’s, and the music will stop automattically when a tts is send )
                            So, When I tried, all I was getting is weird sounds.
                            The output needs to be mp3 here.

                            I will post my files wich process the speech when I come back home.

                            Nb: Running Ubuntu server x64 here

                            Comment


                              #59
                              Originally posted by zwolfpack View Post
                              I've updated post #37...

                              - new capability: prepending text with <voice-id="voice"> selects voice for the message.
                              - new capability: prepending text with <no-cache> prevents that message from being cached. Useful for dynamic messages not likely to be reused.
                              - additional MPEG packages (ffmpeg and/or avtools) are installed if available. For Chromecast support.
                              I was just about to e-mail you about adding a no-cache option, you beat me to it.
                              HomeSeer Version: HS3 Standard Edition 3.0.0.548
                              Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                              Number of Devices: 484 | Number of Events: 776

                              Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                              3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                              4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                              3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                              Z-Net version: 1.0.23 for Inclusion Nodes
                              SmartStick+: 6.04 (ZDK 6.81.3) on Server

                              Comment


                                #60
                                Originally posted by kriz83 View Post
                                Is this available on github ?
                                Want to make some changes to it.
                                PollyC has been added to Github however we're not yet allowing anyone to collaborate on the project. Once we're ready either zWolfPack or I will let everyone know.
                                HomeSeer Version: HS3 Standard Edition 3.0.0.548
                                Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                                Number of Devices: 484 | Number of Events: 776

                                Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                                3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                                4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                                3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                                Z-Net version: 1.0.23 for Inclusion Nodes
                                SmartStick+: 6.04 (ZDK 6.81.3) on Server

                                Comment

                                Working...
                                X