cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Stop the Speech

SOLVED
Highlighted
Aquamarine

Stop the Speech

Hello,

I am using the below code to convert text to speech for my AR experience.

 

$scope.speak = function(){
var spokenText = $scope.view.wdg["label-1"].text;
var msg = new SpeechSynthesisUtterance(spokenText);
window.speechSynthesis.speak(msg);
}

 

Help I need:  I need to be able to stop the speech in middle(in case the speech/text is too long) and move to the next step. 

Any thoughts on how this can be achieved?

 

Avinash

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Stop the Speech

Hi @agangaiah ,

as we discuss this outside the community , you informed me that you already found the solution. Only for the sake of the completeness I will post your solution here:

//=============
//Below method works..
//you can add a button say STOP....call this function stopallaudio()...code as below 
 //=============
$scope.stopallaudio = function(){
window.speechSynthesis.cancel();
}

 

View solution in original post

2 REPLIES 2
Highlighted

Re: Stop the Speech

Hi @agangaiah ,

as we discuss this outside the community , you informed me that you already found the solution. Only for the sake of the completeness I will post your solution here:

//=============
//Below method works..
//you can add a button say STOP....call this function stopallaudio()...code as below 
 //=============
$scope.stopallaudio = function(){
window.speechSynthesis.cancel();
}

 

View solution in original post

Highlighted

Re: Stop the Speech

Yes worked. Thanks

Tags (1)
Announcements
Join an
AR Working Group!

Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection