0
Fixed

Problems using stopSpeach() function

pavel cernocky 3 months ago in SitePal Platinum updated by Gil Sideman 2 months ago 19

Hi.

We would like to use repeatibly sayText() and stopSpeech(), but we are encountering problems.

After few calls, the sayText() does not start speaking.


My colleague created a Github repo based on your Vue.js example and added a sequence of sayText() and stopSpeech() commands to demonstrate this problem.
This link points to commit with our changes to your example:

https://github.com/dominikbrno/Sitepal-vue/commit/c719d1aabbb0f5c62c1bdf2e1b78067ae78ff70a


If I run the example on my computer (3d photoface -> sayText() button), then it always skips the third sentence.

Could you please guide us how to fix this problem?

Thank you.

Answer

+2
Answer

Hi Pavel - this issue should now be fixed. Please clear your browser cache and let me know if you still see the problem.

Best,

Gil

Under review

Hello Pavel - 

We just deployed an update to our playback code that fixes a repeated speech/stop problem. It is most likely the same issue you describe (though the context we looked at was different).

Can you please clear your browser cache and try again - and let me know if the issue is resolved?

If you still encounter a problem we will look into it asap.

Best,

Gil

Hi Gil,

I've just tried it and it still works the same.
Could you please check the code I've shared? It should be simply reproducible.

Thank you.

Pavel

Sure, we will look into it & advise.

Hello Pavel - 

Our engineer tried to build your example and encountered errors - can you advise regarding - 

- version of npm and node being used on your end?

To get it to work we need to recreate your environment.

Thanx

Gil

Hello, this example is based on Your example of embeding in Vue (https://www.sitepal.com/api/examples/vue/Sitepal-vue.zip).
It should work on the same enviroment as the original example as there are no additional dependencies, just a few lines of code demonstration the unreliable behaviour.
I run it on 
npm: 7.7.6
node: 15.14.0

Hi Gil, I don't won't to rush you, just want to ask if there's any progress in this.

We are facing this issue in few customers' instances, so it's a bit time-sensitive for us.

Thanks.

Pavel

Hi Pavel, we are able to recreate the problem and are working on it. I don't yet have an ETA.

I'm wondering - what is your purpose in calling stop speech after 4 seconds? Is there a special reason you need to interrupt the previous speech precisely after that delay? Or is this just a way to recreate the issue & bring it to our attention? (worked!)   

I ask, because if you simply need to interrupt one speech with another, there is no need to use stop speech for that.

Just turn ON "Interrupt Mode" setting, and any newly requested speech will be immediately launched. 

You can do so using the 'setStatus' api call, and it may work better for you.


Regardless - we will address this issue.

Best,

Gil

You guessed it right. The 4 seconds are just to showcase the issue. In real we need to call stopSpeech() on user request. And in that case we don't want to say anything else. 

But we can try what would happen if we call sayText() with empty text and interrupt mode ON. Maybe it will just stop.

Thanks,

Pavel

Understood. 

If the speech is not being stopped by the need to play another audio, then my comment does not apply. You are doing the right thing by calling stopSpeech. No need to modify.

We're looking into it and will let you know when fixed.

Best,

Gil

Hello Pavel - 


We've recreated your example on our test server here - https://www.workboy.com/qa/vue_client_example/index.html

(you need to accept the provisional cert)


We can see, both in your example and in ours, that the third audio sometimes does not play and appears to be skipped. But that is not actually the case.

What happens is that the delayed stopSpeech call is called after sayText is called, but before the audio starts.
So the audio never starts playing and appears to be skipped.

This behavior is per spec. not a bug, but a feature :-)

In your original note you say that - "After few calls, the sayText() does not start speaking." 

it sounds like you may describing a different problem than the one demonstrated by your example.
If that's the case - pls provide a clearer explanation and/or better example - and we will investigate asap.

Best,

Gil

Hello Gil.


I tried to add some logging and also vh_audioStarted/vh_audioEnded callbacks. See the update here https://github.com/dominikbrno/Sitepal-vue/commit/58be85d6e3be81ea514863e4751bc8c839ee0172?diff=split&w=1

Here's the produced log. I've added comments directly to the log.

It doesn't always looks like this, but this is the most common outcome for me.


2024-04-02T09:05:12.038Z: say 1              // first sayText() called
2024-04-02T09:05:12.246Z: vh_audioStarted    // starts speeking after ~200ms
2024-04-02T09:05:16.040Z: stop 1             // stops speaking after ~3800ms, everything ok

2024-04-02T09:05:16.041Z: say 2              // second round, same as first, everything ok
2024-04-02T09:05:16.227Z: vh_audioStarted
2024-04-02T09:05:20.042Z: stop 2

2024-04-02T09:05:20.043Z: say 3              // third sayText() called
2024-04-02T09:05:20.200Z: vh_audioStarted    // starts speeking after ~200ms
2024-04-02T09:05:20.212Z: vh_audioEnded      // but almost immediately this callback fires, in real there's nothing audible
2024-04-02T09:05:24.043Z: stop 3             // stopSpeech() called, but at this time nothing is playing

2024-04-02T09:05:24.043Z: say 4              // fouth iteration, same as first and second
2024-04-02T09:05:24.206Z: vh_audioStarted
2024-04-02T09:05:28.044Z: stop 4

2024-04-02T09:05:28.045Z: say 5              // fifth round, same behaviour as third round, not ok
2024-04-02T09:05:28.207Z: vh_audioStarted
2024-04-02T09:05:28.231Z: vh_audioEnded
2024-04-02T09:05:32.045Z: stop 5


So for me it seems, it's not the case "the delayed stopSpeech call is called after sayText is called, but before the audio starts", you are mentioning.


Could you please try to investigate it more? Or do I miss something?

Also, if there's anything we can help with, please let us know.


Thanks,

Pavel

Thank you for the detailed info. 

We'll look into it and advise asap

Hi Gil,

any update on this issue or some ETA when we can expect some explanation or fix?

Thanks,

Pavel

Hi Pavel - 

We are working on it. I expect that we will have an update soon. 

Thanks for your patience - will advise asap.

+2
Answer

Hi Pavel - this issue should now be fixed. Please clear your browser cache and let me know if you still see the problem.

Best,

Gil

Hi Gil, I checked it and it works brilliant.

Thanks a lot for your effort!

Thank you, Pavel

Pavel, 

Thank you for your patience & feedback as we investigated & addressed this issue.

The nature of the problem, which involved a particular sequence of events and timing, was challenging to track down. Thanks to your assistance we were able to.

Best regards,

Gil