voice icon indicating copy to clipboard operation
voice copied to clipboard

In iOS, onSpeechEnd never called

Open Reactongraph opened this issue 4 years ago • 9 comments

I am having issue with iOS, Android is working perfect issue is onSpeechEnd never called. How can i call a function when its end

Reactongraph avatar Nov 21 '19 12:11 Reactongraph

In iOS, it won't stop when user stop. You need to add a timeout function to stop it.

horstleung avatar Dec 02 '19 08:12 horstleung

@fattomhk Can you give the exact code?

vishaljadav24 avatar Dec 03 '19 15:12 vishaljadav24

Something like this, unknown side effect to Android.

let timeout;
const InitDelay = 3000;
const ContinueDelay = 150;
const handleTimeout = ()=> {
     Voice.stop();
}

Voice.start(locale).then(()=>{
    timeout = setTimeout(handleTimeout, InitDelay);
)

Voice.onSpeechPartialResults = (event) => {
    if(timeout) { 
        clearTimeout(timeout);
    }
    timeout = setTimeout(handleTimeout, ContinueDelay);
}

remember to clear timeout when finish / error .....

horstleung avatar Dec 06 '19 03:12 horstleung

I am running into this .issue. voice recognition does seem to stop after several minutes of silence on iOS

MicahSteinbrecher avatar Dec 11 '19 14:12 MicahSteinbrecher

@fattomhk In the simulator this lib can have problems. Does this happen on your physical device or simulator?

lfoliveir4 avatar Dec 14 '19 15:12 lfoliveir4

@lfoliveir4 My problem is that iOS won't end the speech when user stop speaking but android does. So, I set timeouts for that. Not related to simulator / real device.

horstleung avatar Jan 15 '20 06:01 horstleung

iOS speech services do not end on its own when there is silence, but the framework stops speech recognition tasks that last longer than one minute, as per documentation here SFSpeechRecognizer

So you need to manage that by writing Platform-specific conditions for ios.

whereas for android speech services stop recognition on its own when there is silence or it is running for too long.

tejachundru avatar Mar 27 '20 07:03 tejachundru

I have one issue on ios. when speech end then auto recognition doesn’t work on Ios. we have to stop manually at time.please give response for auto voice end detection.

maysolanki avatar Aug 11 '20 17:08 maysolanki

Any updates here? This repo seems to be not managed well. There are several issues open around iOS

roots-ai avatar Oct 19 '21 06:10 roots-ai