artyom.js icon indicating copy to clipboard operation
artyom.js copied to clipboard

Sometimes it breaks? Continuous mode doesn't work?

Open baptisteArno opened this issue 7 years ago • 3 comments

Hello,

I need my assistant to constantly listen for mic input. But sometimes it just stop listenning (when looking at debug, it doesn't print anything). If I understood well, continuous mode is suppose to restart the "object" right? How can I make sure it doesn't crash?

// Create a variable that stores your instance
    this.artyom = new Artyom();
    // Start the commands !
    this.artyom.initialize({
      lang: 'fr-FR',
      continuous: true, // Listen forever
      soundex: true, // Use the soundex algorithm to increase accuracy
      listen: true,
      debug: true,
      name: 'Watson',
    }).then(() => {
      console.log('Artyom has been succesfully initialized');
    }).catch((err) => {
      console.error(`Artyom couldn't be initialized: , ${err}`);
    });

    this.artyom.on(['*'], true).then((_, wildcard) => {
      this.listenForCommand(wildcard);
    });

    this.artyom.when('SPEECH_SYNTHESIS_START', () => {
      if (this.artyom.isRecognizing()) {
        this.artyom.dontObey();
      }
    });

    this.artyom.when('SPEECH_SYNTHESIS_END', () => {
      if (!this.artyom.isRecognizing() || !this.artyom.isSpeaking()) {
        this.artyom.obey();
      }
    });
listenForCommand(wildcard) {
    this.bip.play();
    this.artyom.say(wildcard);
  }

baptisteArno avatar May 31 '18 16:05 baptisteArno

I'm experiencing the same thing and have not found a way to reproduce it reliably or debug it at all.. if you find out what's happening or have any insight at all.. such as a way to replicate please reply back because I really need to find a way to fix this too.

I wonder if a timeout that reinitializes it every minute would be a workaround

vesper8 avatar Jun 01 '18 00:06 vesper8

I found out how to "reproduce" this problem. It's basically because of the noise. When I use a good mic it works undefinetly as long as I speak clearly. But whenever I speak non words such as 'Aaaaaaaaaa' and noises like these. it crashes. I'll try to find what's happening. I'll let you know..

baptisteArno avatar Jun 01 '18 10:06 baptisteArno

any progress on that? i experience this also just with podcasts in the background or people talking. after some time it restarts and works as expected again but does not print out anything. i simply can not nail the problem down...

zen85 avatar Dec 02 '18 02:12 zen85