Announcement

Collapse
No announcement yet.

Speeding up TTS

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

    Speeding up TTS

    Hi

    I've been playing around with using the Sonos TTS to announce ringing phones and door bells (just in case you don't hear them when the music is otherwise playing).

    There appears to be quite a substantial delay between triggering the speech event and the speech coming out over the speakers.

    I'm not sure whether the delay is caused by the HS/plug-in or whether it is purely a Sonos thing?

    Here's a couple of thoughts/questions:
    - Is there anyway to accelerate the time taken from triggering the event to he Sonos device speaking? Perhaps using a pre-recorded MP3 file rather than TTS?
    - Grouping multiple zones for a single TTS announcement adds to the delay, but having a single event triggering to multiple zones individually makes the TTS happen in serial rather than parallel. Is there a way round this?

    Any other thoughts/guidance on how to make this happen faster?

    NicolaiL
    Nicolai L

    #2
    Over the years, I tried to tweak it as best as I could but the delays come from Sonos and it gets worse as you have more players.

    Examples of issues:
    1. the volume changes happen gradually, so if you send the announcement to quick, you lose the beginning of the announcement. The PI checks what the volume difference is and computes what I think is the minimum wait. Clearly a player on mute and an announcement at high volume is the worst case.
    2. Any command you send to a player that causes the player to do something, get replicated between all players and controllers, that's how Sonos works. So if you send commands too fast, it would lose commands like "play" and nothing would play, so some minor waits have been inserted here and there
    3. Saving your tracks in your queue takes a little (and gets synchronized between players). If I do it too fast, I've lost the queue and upon restoration the players would not play, so there are some waits and retries built in

    So at this point, I don't know of anymore optimizations and yes a lot happens actually in parallel. Thanks for the suggestions though but your proposals wouldn't affect the overall time too much as the players still need to act to what I tell them to do and absorb all the events from their peer players. I experimented a lot with other functions within Sonos to group faster but couldn't get it to work and when I trace what the Sonos Controllers do, I do exactly the same, it is just that I need to store a lot and adjust a bunch which the Sonos controller obviously doesn't need to do when it groups some players.

    How long does it take on average in your case? How many players?

    Dirk

    Comment


      #3
      Hi

      I've got 7 zones. It takes at least 5 seconds to get the player started in the case of TTS to a single zone. Obviously takes longer when multiple zones are involved.

      Sometimes the delay is so long that the playing doesn't start until someone has actually opened the front door.

      I might add in some conditions to ensure I only use TTS when music is actually playing.
      Nicolai L

      Comment


        #4
        Originally posted by NicolaiL View Post
        Hi

        I've got 7 zones. It takes at least 5 seconds to get the player started in the case of TTS to a single zone. Obviously takes longer when multiple zones are involved.

        Sometimes the delay is so long that the playing doesn't start until someone has actually opened the front door.

        I might add in some conditions to ensure I only use TTS when music is actually playing.
        Which version of the PI are you on?
        What is the value of AnnouncementWaitforPlayTime in your HSPI_Sonoscontroller.ini file?

        If you are not on version .111 or higher, suggest you upgrade, edit the .ini file and set AnnouncementWaitforPlayTime=0 and try again.

        Dirk

        Comment


          #5
          Originally posted by dcorsus View Post
          Which version of the PI are you on?
          What is the value of AnnouncementWaitforPlayTime in your HSPI_Sonoscontroller.ini file?

          If you are not on version .111 or higher, suggest you upgrade, edit the .ini file and set AnnouncementWaitforPlayTime=0 and try again.

          Dirk
          Thanks for the suggestion. I was on .110 and I'm now on .113

          Unfortunately this (and setting AnnouncementWaitforPlayTime=0) made no difference to the delay, irrespective of whether I do a group or one at a time.

          If this is down to Sonos then I guess there isn't much you can do about it, but thanks for your input!
          Nicolai L

          Comment


            #6
            Originally posted by NicolaiL View Post
            Thanks for the suggestion. I was on .110 and I'm now on .113

            Unfortunately this (and setting AnnouncementWaitforPlayTime=0) made no difference to the delay, irrespective of whether I do a group or one at a time.

            If this is down to Sonos then I guess there isn't much you can do about it, but thanks for your input!
            as I stated, it is a Sonos thing but 5 seconds do sounds long though. Is this a slow PC, slow network?

            If you are willing to turn debug flag on, log to disk and email the log, I can check whether I see something that is taking too much time.

            Dirk

            Comment


              #7
              It's an Atom PC with Win7 32 bit and 4GB memory, running nothing but HS. The network is a GigE network with no issues.

              Thanks for the offer! I'll do that when I get a chance and will upload to this thread.

              Cheers
              Nicolai
              Nicolai L

              Comment


                #8
                Originally posted by NicolaiL View Post
                It's an Atom PC with Win7 32 bit and 4GB memory, running nothing but HS. The network is a GigE network with no issues.

                Thanks for the offer! I'll do that when I get a chance and will upload to this thread.

                Cheers
                Nicolai
                What version of HS? When you restart the HS PC, is it faster or same 5 seconds (trying to rule out resource leaks on PC)?

                Dirk

                Comment


                  #9
                  HS is HS 2.5.0.80

                  Yeah, no difference if done straight after startup. Busy system in some ways, 565 devices and 236 events, but everything else runs pretty well.
                  Nicolai L

                  Comment


                    #10
                    Originally posted by NicolaiL View Post
                    - Is there anyway to accelerate the time taken from triggering the event to he Sonos device speaking? Perhaps using a pre-recorded MP3 file rather than TTS?
                    If you want to try this do the following:
                    1. generate the event that produces your announcement.
                    2. In the <HS root>\html\sonoscontroller\announcements subdirectory you'll find the .wav files that have been generated. The naming convention is something like ann_linkgroupname_sequenceNumber.wav
                    3. pick your announcement file and rename it to whatever you want.
                    4. If the announcement files are large, you can search on-line to convert from .wav to .mp3
                    5. change your event. Instead of having a "SPEAK" action, change the text to the FULL file path name of the file you just renamed/saved (check help file if not clear)
                    6. Test your event, it should play this file instead of calling the speakerclient to convert text to speech.
                    7. If you hear the file name being spoken, then the file is inaccessible because you did not specify the full filename including path, the file name is wrong or the file cannot be accessed
                    8. If this significantly improves on time, then there is something wrong with the speakerclient because on my setup it is pretty much instantaneous

                    Comment


                      #11
                      Originally posted by dcorsus View Post
                      If you want to try this do the following:
                      1. generate the event that produces your announcement.
                      2. In the <HS root>\html\sonoscontroller\announcements subdirectory you'll find the .wav files that have been generated. The naming convention is something like ann_linkgroupname_sequenceNumber.wav
                      3. pick your announcement file and rename it to whatever you want.
                      4. If the announcement files are large, you can search on-line to convert from .wav to .mp3
                      5. change your event. Instead of having a "SPEAK" action, change the text to the FULL file path name of the file you just renamed/saved (check help file if not clear)
                      6. Test your event, it should play this file instead of calling the speakerclient to convert text to speech.
                      7. If you hear the file name being spoken, then the file is inaccessible because you did not specify the full filename including path, the file name is wrong or the file cannot be accessed
                      8. If this significantly improves on time, then there is something wrong with the speakerclient because on my setup it is pretty much instantaneous
                      Thanks, dcorsus. I have the same problem. The TTS is like 5sec delayed and other times it is queued up and plays after 20sec are so. I tried everything that you mentioned above. My Plug-in version is 3.0.0.21. Any help is very much appreciated. Please let me know if you need any log files etc. I have around 6 Sonos. Thanks a lot.
                      Last edited by ssk; February 20, 2017, 01:33 AM. Reason: additional info

                      Comment


                        #12
                        Originally posted by ssk View Post
                        Thanks, dcorsus. I have the same problem. The TTS is like 5sec delayed and other times it is queued up and plays after 20sec are so. I tried everything that you mentioned above. My Plug-in version is 3.0.0.21. Any help is very much appreciated. Please let me know if you need any log files etc. I have around 6 Sonos. Thanks a lot.
                        20 seconds sounds a lot but then again, all depends on what players where doing, queues that need to be saved, players that need to be volume adjusted, unlinked, regrouped etc. network performance, PC performance.

                        You can always post a log with 'debug on' from start of event until announcement is played. Suggest you also post screen shots of your linkgroup table and your events. Make sure you post ALL, it will be more than one screen from the log table ..

                        Dirk

                        Comment


                          #13
                          Thanks, Dirk.

                          I was trying lot of different thing this morning and last night to see if I can improve the speed but no luck.

                          Attaching the screenshots as per your advice. Nothing was playing at Sonos speakers when the events were triggered.

                          HomeSeer Log:
                          Click image for larger version

Name:	HomeSeer_Log.JPG
Views:	1
Size:	130.1 KB
ID:	1189015

                          HomeSeer Event:
                          Click image for larger version

Name:	GrageDoorEvent.JPG
Views:	1
Size:	81.3 KB
ID:	1189016

                          Sonos PI Config:
                          Click image for larger version

Name:	SonosPIConfig.jpg
Views:	1
Size:	77.8 KB
ID:	1189017

                          Please let me know if you need any additional info.

                          Thanks a lot.

                          Comment


                            #14
                            Originally posted by ssk View Post
                            Thanks, Dirk.

                            I was trying lot of different thing this morning and last night to see if I can improve the speed but no luck.

                            Attaching the screenshots as per your advice. Nothing was playing at Sonos speakers when the events were triggered.

                            HomeSeer Log:
                            [ATTACH]59676[/ATTACH]

                            HomeSeer Event:
                            [ATTACH]59677[/ATTACH]

                            Sonos PI Config:
                            [ATTACH]59678[/ATTACH]

                            Please let me know if you need any additional info.

                            Thanks a lot.
                            The event for "Garage door closed" is wrong. You should change the "Speak the content of the file" to a "speak" action.
                            Secondly, make sure you "debounce" door open/close events so you filter out multiple (false) events. The open has a 30 second time, the close has none.

                            The log shows you have an issue playing an announcement but the log doesn't show anything else. You should change your settings and REMOVE the "Log Errors only flag" because it suppresses everything else that is being logged. Also turn off the superdebug flag which generates a lot of logging that is not needed to troubleshoot this.

                            Are the status of the Sonos devices still being updated properly? What firewall are you using? Is the HSPI_Sonos.exe allowed through the firewall? It is not enough that HS3 is allowed by the firewall, all PIs run as standalone programs and they all need their own allowance.

                            Dirk

                            Comment


                              #15
                              Thanks Dirk, my comments are below...

                              >>The event for "Garage door closed" is wrong. You should change the "Speak the content of the file" to a "speak" action.
                              Yes I fixed it yesterday. I was trying many different things to see if it would fix the problem

                              >>Secondly, make sure you "debounce" door open/close events so you filter out multiple (false) events. The open has a 30 second time, the close has none.
                              Can you provide more details on this please. I have 30 second timer for Open because the event is checking for open status of the door that is at least 30 sec and I want the event to be triggering every 30 sec. For Close, the even will trigger only ones and is the reason why I do not have 30 sec timer for re-triggering.

                              >>The log shows you have an issue playing an announcement but the log doesn't show anything else. You should change your settings and REMOVE the "Log Errors only flag" because it suppresses everything else that is being logged. Also turn off the superdebug flag which generates a lot of logging that is not needed to troubleshoot this.
                              I changed the log settings as per your suggestion and converted the HS log to CVS. Please link for log file that is converted in to CVS file. The log file is too big to upload.

                              >>Are the status of the Sonos devices still being updated properly? What firewall are you using? Is the HSPI_Sonos.exe allowed through the firewall? It is not enough that HS3 is allowed by the firewall, all PIs run as standalone programs and they all need their own allowance.
                              I am using windows firewall and here is the screenshot of the plugin settings in windows firewall. every thing is allowed.
                              Click image for larger version

Name:	SonosPIFirewallCapture.jpg
Views:	1
Size:	11.8 KB
ID:	1189031

                              Please let me know if you need additional information. thank you for your help. looking forward to have this fixed and use my TTS reliably.

                              Comment

                              Working...
                              X