MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. whyjustin
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    W
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 17
    • Groups 0

    Posts

    Recent Best Controversial
    • Yet Another Voice Module (Sphinx + Alexa)

      Hey all,

      I’m happy to be making my first post to this community. I discovered it recently when embarking upon making a Magic Mirror and am impressed by the active support and discussion that occurs. Not sure if this post belongs in Development or Showcase as the module is mostly done, but I just had a daughter and may not be able to provide initial support for it so wanted to do a soft release here first.

      I know there are existing voice modules for MM2 but I found my use case was to use Alexa alongside Sphinx, providing all the voice recognition functionality within one module. This prevents different modules competing for resources (microphone) and having to synchronize the allocation and deallocation of these resources. The hope is that non-audio related functionality will be handled by other modules, there is a not yet documented command with action “sendNotification” that will allow configuring certain voice commands to invoke a process in a different module.

      Another goal for this project was to eliminate the need for lengthy configuration and setup. The module prefers convention to configuration, and most of the nerdy voice recognition and Alexa setup is bootstrapped for the user during the load. This allows the user to have a simple json configuration and the module will generate the appropriate ssh keys and language models/dictionaries required for the module to work.

      Enough talk, here is the module. Pull requests warmly welcome, around documentation or functionality. Thanks.

      https://github.com/whyjustin/magic-mirror-voice

      posted in Development
      W
      whyjustin
    • RE: Yet Another Voice Module (Sphinx + Alexa)

      So it its always listening in your version?

      Yup, Sphinx is always listening (as long as Alexa is not listening). You can configure the command that invokes Alexa in the sphinx:commands dictionary. Any key in the object will be recognized by Sphinx and perform the action as configured by the value. For example:

      "mirror mirror": {
        action: 'alexa'
      }
      

      Saying “mirror mirror” will trigger Alexa.


      Note from admin: Please use Markdown on code snippets for easier reading!

      posted in Development
      W
      whyjustin
    • RE: Yet Another Voice Module (Sphinx + Alexa)

      Now the problem is that the module is not registering. I cannot connect to that link if I put it in a browser.

      This is a long shot since you’ve setup Alexa already, but are you using a browser on the pi to connect to the site? If not you would have to replace localhost with the pi’s IP/Hostname

      Also, I think it should be localhost:3000/provision/… because that’s how the alexa standalone app registration works but I could be wrong.

      The oauth service can run on any port, I believe that 3000 may been taken by another process on my raspberry pi (either by Magic Mirror or something else) which is I why I used 5555. I think there is some redundancy in the three options (port/serviceUrl/redirectUrl) but it is required to keep the same port and hostname on all three. If you choose to keep 5555, you will have to update the Alexa settings that you previously set up to indicate the proper port:

      https://github.com/alexa/alexa-avs-raspberry-pi/blob/master/assets/avs-web-settings-filled.png

      posted in Development
      W
      whyjustin
    • RE: Yet Another Voice Module (Sphinx + Alexa)

      @clumsy_ninja said in Yet Another Voice Module (Sphinx + Alexa):

      @whyjustin Yeah thats it. Do i need to record a new training file to replace those or where did the original one come from?

      The plugin will automatically generate your models and dictionary on startup using the JSON property names (e.g. “mirror mirror”) if the sphinx-model-generator/commands.dic and sphinx-model-generator/commands.lm are missing. So remove those files, adjust the JSON, then start the plugin again. You can also manually edit the commands.lm and commands.dic files after they are automatically generated if you are comfortable with language modeling.

      posted in Development
      W
      whyjustin
    • 1 / 1