voice icon indicating copy to clipboard operation
voice copied to clipboard

Is it possible to disable speech recognition ending automatically?

Open zhish3n opened this issue 6 years ago • 20 comments

I would like to use the module for longer phrases and perhaps even paragraphs, but the module automatically stops when there is a short pause detected. Any way to disable this and only stop recognition when the user presses a button?

zhish3n avatar Jul 03 '18 13:07 zhish3n

@ZhiSh3n I also want the same kind of stuff.

devblucursor avatar Jul 11 '18 12:07 devblucursor

@devblucursor I believe it is possible by setting the EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS constant, which you can read about here. However, my experiments seem to indicate that setting this constant will not have any effect on API < 8.

zhish3n avatar Jul 11 '18 13:07 zhish3n

@ZhiSh3n Thanks! Man :)

devblucursor avatar Jul 12 '18 10:07 devblucursor

I have been looking for a solution for this issue as well, but so far without any luck... It seems that this issue is not related to this module, but the issue lies with android itself. Not sure if there is any fix out there. Have thought about creating a method which would automatically trigger recording again if android stops it, but haven't been successful with that one yet either.

krigame avatar Jul 17 '18 10:07 krigame

I really need it too =(

GabrielDvt avatar Aug 08 '18 04:08 GabrielDvt

we can expose this option on javascript side

we gonna accept a PR that solves this

sibelius avatar Nov 03 '18 22:11 sibelius

are there any news on this feature?

yougeen avatar Jul 05 '19 11:07 yougeen

nu?

nachumFreedman avatar Jul 25 '19 13:07 nachumFreedman

any update??

vaibhgupta09 avatar Nov 07 '19 14:11 vaibhgupta09

@zhish3n Did your solved your problem?

lfoliveir4 avatar Dec 16 '19 12:12 lfoliveir4

would love to see any solutions anyone has found

sjc5 avatar Feb 14 '20 20:02 sjc5

+1

ghost avatar Feb 28 '20 14:02 ghost

I chose to check it every half second and just refresh if it has ended:

async checkRecognition() {
  await Voice.isRecognizing().then(result => {
    if (result != 1) {
      Voice.start('en-US')
    } else {
      return true
    }
  })
}

jmarsto avatar Mar 15 '20 19:03 jmarsto

would love to see any solutions anyone has found

try my logic ...

  • create looping after speech end

onSpeechEnd = (e) => { this._startRecognizing(); };

  • handle stop with add var for condition

onSpeechEnd = (e) => { if (this.state.end == false) { this._startRecognizing(); } };

_startRecognizing = () => { this.setState({ end: false, }); Voice.start("in-ID"); };

_stopRecognizing = () => { Voice.stop(); this.setState({ end: true, }); };

amma-dev avatar Oct 05 '20 04:10 amma-dev

would love to see any solutions anyone has found

try my logic ...

  • create looping after speech end

onSpeechEnd = (e) => { this._startRecognizing(); };

  • handle stop with add var for condition

onSpeechEnd = (e) => { if (this.state.end == false) { this._startRecognizing(); } };

_startRecognizing = () => { this.setState({ end: false, }); Voice.start("in-ID"); };

_stopRecognizing = () => { Voice.stop(); this.setState({ end: true, }); };

  • for handle the result, create temp

onSpeechPartialResults = (e) => { this.setState({ partialResults: e.value }); };

onSpeechEnd = (e) => { if (this.state.partialResults == "") { this.setState({ status: "End", }); } else { this.setState({ status: "End", partialResults: "", temp: this.state.temp + " " + this.state.partialResults, }); } if (this.state.end == false) { this._startRecognizing(); } };

  • get the total result in state.temp

good luck ;)

amma-dev avatar Oct 05 '20 04:10 amma-dev

any legit way to stop voice recognition to NOT stop by itself? looping it could be an option but it's not a legit solution.

numanqmr avatar Mar 22 '21 14:03 numanqmr

@krigame Have you found a solution to this !?

Hostname47 avatar Jun 08 '23 22:06 Hostname47

Hey guys, please any update about this ?

amefire avatar Jun 12 '23 10:06 amefire

Hello @everyone, If anyone have found a solution, then please respond here, as so many people have been waiting for a solution like this.

aliraza96 avatar Aug 22 '23 11:08 aliraza96

Any solution yet?

daheeahn avatar May 14 '24 02:05 daheeahn