Announcement

Collapse
No announcement yet.

Caching Speech routines using Amazon Polly

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

    #61
    What's the repo on GitHub? There are many PollyC projects...

    Comment


      #62
      I think we may add to the title but for now look for my user name timon0x31.
      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


        #63
        To clone the project from GitHub ...

        First, install git

        Code:
        sudo apt-get -y install git
        git config --global user.email "you@example.com"
        git config --global user.name "Your Name"
        Next, clone the project
        Code:
        git clone https://github.com/Timon0x31/PollyC.git
        This creates a subfolder "PollyC" with the project files.

        To install,

        Code:
        cd PollyC
        sudo make install-pollyc keyid=your_keyid accesskey=your_secret [ region=your-region-x ] [ voice=Voice ]

        Comment


          #64
          hi!


          is there a way to send
          Code:
          '
          in the text?

          If i write ''my name is matt'' it is playing ok.
          but if i write ''my name's matt'' i got this error.


          Code:
          In SpeakDev calling a speak proxy plug-in, exception is ApplicationName='./speak_to_file.sh', CommandLine=''/HomeSeer/Temp/AirplaySpeak20200205221145159.wav' 'My name's matt'', CurrentDirectory='', Native error= Success Service Version: NO_VERSION
          i guess it does not like this formatting
          'My name' s matt''


          Comment


            #65
            Quotes (single and double) are special to the shell and need special handling when passed to a script. HS isn't doing that, hence this error.

            Comment


              #66
              i know. I tried many things... but the command is sent to the shell like this and there is no way to modify this .

              So...i can't send any apostrophe with speak commands.

              i guess i'll put in a ticket or try it on hs4 and bring it as a hs4 bug.


              this is problematic if i send a voice command directly by voice from my iphone : see this thread https://forums.homeseer.com/forum/ho...hone-shortcuts

              see post #1 and 17

              edit: got a work around.. but would like a better solution from hst ( i could had some other sed command but it will never end..) :

              Code:
              SPEAK="i'm beautiful and you're stupid"; SPEAKALT=$(echo $SPEAK| sed "s/ /%20/g"| sed "s/i'm/i%20am/g"| sed "s/'//g"); curl "http://127.0.0.1:PORT/JSON?request=setdevicestatus&ref=2947&string=$SPEAKALT"

              Comment


                #67
                just wanted to annonce it in case you'll go to ubuntu 20.04:

                7. No more Python 2


                Python 2 was first release in 2000. After twenty years, Python 2 has finally reached end of life.

                Ubuntu 20.04 won’t support Python 2 anymore and you’ll have to content yourself with Python 3.

                I’ll update this article as the development progresses.
                https://itsfoss.com/ubuntu-20-04-release-features/

                The python 3 script works nice here

                Comment


                  #68
                  hi all im new to homeseer been using many hubs and automation systems before now.

                  i have installed the polly script on my raspberry pi which Im running the homeseer demo on.

                  so what do I need to do now any more ssh setups ?

                  sorry im a bit confused how to do the rest to make it work with Sonos

                  hope you will guide me on the right path.

                  Originally posted by zwolfpack View Post
                  To clone the project from GitHub ...

                  First, install git

                  Code:
                  sudo apt-get -y install git
                  git config --global user.email "you@example.com"
                  git config --global user.name "Your Name"
                  Next, clone the project
                  Code:
                  git clone https://github.com/Timon0x31/PollyC.git
                  This creates a subfolder "PollyC" with the project files.

                  To install,

                  Code:
                  cd PollyC
                  sudo make install-pollyc keyid=your_keyid accesskey=your_secret [ region=your-region-x ] [ voice=Voice ]

                  Comment


                    #69
                    The Sonos help file details how to set up for announcements. Once that is configured, it will use the Polly voices, via the speak_to_file.sh script.

                    Once you get Sonos TTS working, if it speaks with a mechanical sounding voice instead of the selected Polly one, verify the contents of the Polly.keys file in the HomeSeer root folder.

                    Attached shows an event that speaks to the Sonos LVR linkgroup.
                    Attached Files

                    Comment


                      #70
                      zwolfpack Thank you it was quite simple. cool that homeseer just regonize the script without any changes in the setup ui control panel.

                      Comment


                        #71
                        i have discovered one thing about the polly. In Denmark we have special chars se picture.
                        when I test it on the polly service on amazon it works. and when I test it on another hub with polly I have it works.
                        but when I do the same here at homeseer it do not regonize the special chars
                        and will the not use polly and try to speak maybe the normal tts service, and it do not sound correct.

                        is there any way to make this work ?

                        Click image for larger version

Name:	Skærmbillede 2020-06-30 kl. 14.48.51.png
Views:	65
Size:	18.8 KB
ID:	1397790

                        Comment


                          #72
                          If it's speaking with the non-polly voice, it means that the polly call encountered an error. Can you paste in the phrase from the event and the voice name and I can give it a try.

                          Comment


                            #73
                            FWIW: I created an event with speak text "rødgrød med flødeskum", and it seems to work to my Sonos with Polly Danish voices 'Naja' and 'Mads' as well as an English voice.

                            Comment


                              #74
                              Hmm Strange because when I use øæå in a phrase it Will not Play correct.

                              What about setup what Area code are you using. With danish voices ?


                              Sent from my iPhone using Tapatalk Pro

                              Comment


                                #75
                                My region is 'us-west-1'.

                                To enable debug, execute this Linux command
                                Code:
                                touch /tmp/tts.debug
                                Then run the speak event. Look for the file /tmp/speak_to_file.log and see if there's any indication of the problem. (Make sure to delete key info prior to posting).

                                Here's mine:
                                Code:
                                Region: us-west-1
                                Key ID: ---
                                Key: ---
                                Text: øæå
                                Voice: Naja
                                Format: mp3
                                Text Type: text
                                Polly Output: /tmp/speak_to_file10118.mp3
                                Cache File: /opt/HomeSeer/./PollyCache/2226a16e82efdec6b79c17d2300c482e22a534887944363940a1e56915377a456e34d3782f984bd0d191f0838d86075389c4fdff8cbaa1f2de99150fae98da06.mp3
                                Cache Hit: False
                                /opt/HomeSeer/html/Sonos/Announcements/Ann_LVR_0.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz
                                Attached Files

                                Comment

                                Working...
                                X