Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to disable speech recognition ending automatically? #107

Open
zhish3n opened this issue Jul 3, 2018 · 20 comments
Open

Is it possible to disable speech recognition ending automatically? #107

zhish3n opened this issue Jul 3, 2018 · 20 comments

Comments

@zhish3n
Copy link

zhish3n commented Jul 3, 2018

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?

@devblucursor
Copy link

@zhish3n I also want the same kind of stuff.

@zhish3n
Copy link
Author

zhish3n commented Jul 11, 2018

@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.

@devblucursor
Copy link

@zhish3n Thanks! Man :)

@krigame
Copy link

krigame commented Jul 17, 2018

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.

@GabrielDvt
Copy link

I really need it too =(

@sibelius
Copy link
Collaborator

sibelius commented Nov 3, 2018

we can expose this option on javascript side

we gonna accept a PR that solves this

@yougeen
Copy link

yougeen commented Jul 5, 2019

are there any news on this feature?

@nachumFreedman
Copy link

nu?

@vaibhgupta09
Copy link

any update??

@lfoliveir4
Copy link
Collaborator

@zhish3n Did your solved your problem?

@sjc5
Copy link

sjc5 commented Feb 14, 2020

would love to see any solutions anyone has found

@ghost
Copy link

ghost commented Feb 28, 2020

+1

@jmarsto
Copy link

jmarsto commented Mar 15, 2020

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
    }
  })
}

@amma-dev
Copy link

amma-dev commented Oct 5, 2020

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
Copy link

amma-dev commented Oct 5, 2020

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 ;)

@numanqmr
Copy link

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.

@Hostname47
Copy link

@krigame Have you found a solution to this !?

@amefire
Copy link

amefire commented Jun 12, 2023

Hey guys, please any update about this ?

@aliraza96
Copy link

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

@daheeahn
Copy link

Any solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests