C-Nedelcu / talk-to-chatgpt

Talk to ChatGPT AI using your voice and listen to its answers through a voice
GNU Affero General Public License v3.0
1.97k stars 331 forks source link

Stop and Pause voice commands sometimes fail. #29

Closed rmvgaines closed 1 year ago

rmvgaines commented 1 year ago

Sometimes the speech-to-text outputs "Pause." and "Stop." instead of "Pause" and "Stop". The periods at the end of the words cause the plugin not to recognize them. This can be corrected with the following changes:

// if (final_transcript.toLowerCase() == CN_SAY_THIS_WORD_TO_STOP) {
if (final_transcript.toLowerCase() == CN_SAY_THIS_WORD_TO_STOP || final_transcript.toLowerCase().slice(0, -1) == CN_SAY_THIS_WORD_TO_STOP) {
// if (final_transcript.toLowerCase() == CN_SAY_THIS_WORD_TO_PAUSE) {
if (final_transcript.toLowerCase() == CN_SAY_THIS_WORD_TO_PAUSE || final_transcript.toLowerCase().slice(0, -1) == CN_SAY_THIS_WORD_TO_PAUSE) {
C-Nedelcu commented 1 year ago

This has been addressed in v2.0. Thanks for your feedback!