MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Hotword

    Scheduled Pinned Locked Moved System
    60 Posts 20 Posters 29.7k Views 17 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? Offline
      A Former User
      last edited by A Former User

      MMM-Hotword

      MMM-Hotword is a hotword detector using snowboy.
      You can use this module to wake another voice assistant or to give a command to other module.

      Screenshot

      screenshot

      UPDATES

      2.0.0 (2019-05-19)

      • Whole new build-up
      • Some annoying dependencies are removed.
      • Installer is provided. (installer/install.sh)
      • Personal model trainer is provided. (trainer/trainer.sh)
      • Continuous recording after hotword detection is supported (Now you can say like “Computer, volume up” without pausing between Computer and volume up)
        • This feature could be used with MMM-AssistantMk2 ver3.x(Not yet released, but will arrive soon)
        • Or you can use this feature with other AI or Speech-To-Text program.
      • Simple standalone commands could be available. (Without any Assistant or Speech-To-Text, you can make own voice commands with this module standalone.). Commands could be combined sequence (You can make “volume-louder” with voice models “volume” and “louder”)
      • More universal models are added. (computer, subex, hey extreme and more.)
      • Hotword detected could be displayed on screen of MM.

      Download

      [card:eouia/MMM-Hotword]

      Last Tested; (2019-05-19)

      • MagicMirror : v2.7.1
      • Tested Environment :
        • Raspbian Stretch (Raspbian 3B+) / node v8.16.0 / npm v6.4.1
        • TinkerOS (TinkerBoard)
        • Ubuntu 18.04 (NVIDIA Jetson Nano)
        • OSX 10.14.4 (Apple MacBookPro) / node v11.12.0 / npm v6.7.0
      1 Reply Last reply Reply Quote 4
      • bheplerB Offline
        bhepler Module Developer
        last edited by bhepler

        Excellent! I can finally get my mirror to respond to a particular swear word. It’s a literary reference. Honest.

        cowboysdudeC 1 Reply Last reply Reply Quote 1
        • cowboysdudeC Offline
          cowboysdude Module Developer @bhepler
          last edited by

          @bhepler said in MMM-Hotword:

          Excellent! I can finally get my mirror to respond to a particular swear word. It’s a literary reference. Honest.

          HAHAHAHA Nice…

          1 Reply Last reply Reply Quote 0
          • cowboysdudeC Offline
            cowboysdude Module Developer
            last edited by

            Great job @Sean!!

            1 Reply Last reply Reply Quote 0
            • richland007R Offline
              richland007
              last edited by

              @Sean Will you are again the man to ask about my last predicament!!
              It is regarding MMM-Hotword … i have AlexaPi installed independently of Magic Mirror on the same Rpi and i want to install MMM-Voice as well but they are conflicting over microphone resources how can i use them both with either 1 ore 2 USB mics ( i have 2 mics if it’s easier) but don’t know how to configure them to be used by the 2 programs - 1 each. Will MMM-Hotword be able to achieve that i want to do use Alexa and Voice module on the same mirror.
              Again please point me to the right direction.
              Denis

              ? 1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @richland007
                last edited by

                @richland007
                First, I haven’t been using AlexaPi and MMM-Voice.
                With short glance, It seems different mic could be assigned to AlexaPi and MMM-Voice separately.
                (See the AlexaPi and MMM-Voice Configuration.)
                But I don’t know whether it would work or not.
                And I’m not sure MMM-Hotword would do that. Because AlexaPi is out of MM. So, It is not controllable by MM. You should use another mic or even another RPI.
                I think, The better way of voice controlling with Alexa is to use Alexa Skill, - like MirrorMirrorOnTheWall

                1 Reply Last reply Reply Quote 1
                • M Offline
                  maxbachmann
                  last edited by

                  @Sean
                  ah great thought I already seen I alexa module that receives the messages. I guess thats a lot better (and easier) solution than running two voice recognitions. he also has a quite good docu on how to set up the whole alexa skill stuff :thumbs_up:

                  1 Reply Last reply Reply Quote 0
                  • richland007R Offline
                    richland007
                    last edited by

                    Oh dang i did not see the MirrorMirrorOnTheWall module…let me see how difficult is to implement that and i will bother you again LOL :)
                    thank you guys @Sean

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      themc
                      last edited by

                      is there anyway to integrate hotword with xscreensaver so i can blank the screen at 10 minutes and it pops back on whenever i say the hotword to the mirror ?

                      ? 1 Reply Last reply Reply Quote 0
                      • ? Offline
                        A Former User @themc
                        last edited by

                        @themc
                        I think possible.
                        With MMM-notficationTrigger, you can override HOTWORD_DETECTED notification to any notification for any other modules.
                        So, If you have some module which can awake screen (I don’t know whether really that kind of module exists), it is possible.
                        If it doesn’t exist, hmmm. you might be able to fork this repository and modify it for that purpose.

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          themc
                          last edited by

                          haha im a newbie when it comes to coding and finding the right lines but ill have a look arround to see if i can fix something up. i know xscreensaver can be turned on by the following command in terminal:

                          -activate Tell xscreensaver to turn on immediately (that is, blank the screen, as if the user had been idle for long enough.) The screensaver will deactivate as soon as there is any user activity, as usual.
                          It is useful to run this from a menu; you may wish to run it as

                          sleep 5 ; xscreensaver-command -activate
                          to be sure that you have time to take your hand off the mouse before the screensaver comes on. (Because if you jiggle the mouse, xscreensaver will notice, and deactivate.)

                          so i think it should be possible to link a hotword to that line to execute it

                          T 1 Reply Last reply Reply Quote 0
                          • T Offline
                            themc @themc
                            last edited by

                            @themc @myself the correct command would be

                            -deactivate
                            This tells xscreensaver to pretend that there has just been user activity. This means that if the screensaver is active (the screen is blanked), then this command will cause the screen to un-blank as if there had been keyboard or mouse activity. If the screen is locked, then the password dialog will pop up first, as usual. If the screen is not blanked, then this simulated user activity will re-start the countdown (so, issuing the -deactivate command periodically is one way to prevent the screen from blanking.)

                            ? 1 Reply Last reply Reply Quote 0
                            • ? Offline
                              A Former User @themc
                              last edited by A Former User

                              @themc
                              If you want just to use MMM-Hotword as screensaver-awakener,
                              modify node_helper.js ;

                              // add this in line 1:
                              var exec = require('child_process').exec
                              ...
                              // around line 86
                              .on('hotword', (index, hotword, buffer)=>{
                                exec ("xscreensaver-command -deactivate", (err, stdout, stderr)=>{})
                              ...
                              
                              
                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                themc
                                last edited by

                                awesome ill try it out right away

                                ? 1 Reply Last reply Reply Quote 0
                                • ? Offline
                                  A Former User @themc
                                  last edited by

                                  @themc
                                  Not tested. I wrote that post by your description. So I don’t know whether it works really.
                                  But you can find a way how to work.

                                  1 Reply Last reply Reply Quote 0
                                  • Cr4z33C Offline
                                    Cr4z33
                                    last edited by

                                    Does anybody know what to edit to use custom hotwords (yes I created them in the Snowboy dashboard)?

                                    ? 1 Reply Last reply Reply Quote 0
                                    • ? Offline
                                      A Former User @Cr4z33
                                      last edited by

                                      @cr4z33
                                      Go to snowboy and signup (https://snowboy.kitt.ai).
                                      It’s better to do in your target device (Raspberry Pi)
                                      After login, you can see create Hotword button. click then follow instruction.
                                      After that, you can get your personal model (.pmdl)
                                      put that file into MMM-Hotword/resources then modify configuration.
                                      By example, you recorded and get abracadabra.pmdl,
                                      your configuration will be

                                       snowboy: [
                                        {
                                          hotwords: "abracadabra", 
                                          file: "resources/models/abracadabra.pmdl",
                                          sensitivity: '0.5',
                                        },
                                        ...
                                      

                                      Then you can catch abracadabra by your voice.

                                      Cr4z33C 1 Reply Last reply Reply Quote 1
                                      • Cr4z33C Offline
                                        Cr4z33 @Guest
                                        last edited by

                                        @sean
                                        Hmm that’s exactly what I did so either I am setting the wrong hotwords: word or there’s something more needed to edit?

                                        In my case I have recorded the hotwords ‘OK Google’ and ‘Ehi Google’ and apart from the proper file name and path I set hotwords: "okgoogle", and hotwords: "ehigoogle",.

                                        Also… can I use spaces into the quotes?

                                        ? 1 Reply Last reply Reply Quote 0
                                        • ? Offline
                                          A Former User @Cr4z33
                                          last edited by A Former User

                                          @cr4z33
                                          See hotwords:okgoogle.
                                          okgoogle is a symbol for your voice. If MMM-Hotword detect your okgoogle.pmdl(is file name right?), It will return okgoogle as detection.
                                          Then, if you want ot use that symbol as AssistantMk2 profile name to activate, modify configuration of MMM-AssistantMk2 like this.

                                          defaultProfile: "okgoogle",
                                          profiles: {
                                             "okgoogle" : {
                                                  profileFile: "default.json",
                                                  lang: "en-US",
                                          ...
                                          

                                          So, received “okgoogle” symbol will be used as profile name “okgoogle” with profile File “default.json”.

                                          Cr4z33C 1 Reply Last reply Reply Quote 0
                                          • Cr4z33C Offline
                                            Cr4z33 @Guest
                                            last edited by

                                            @sean
                                            A-ha that’s the file name then?
                                            That was my mistake because I named them ok_google.pmdl and ehi_google.pmdl!

                                            Thanks.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy