• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Control your Mirror Volume with Voice ( MMM-AssistantMk2 )

Scheduled Pinned Locked Moved Development
1 Posts 1 Posters 914 Views 1 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.
  • E Offline
    ejay-ibm Project Sponsor Module Developer
    last edited by ejay-ibm Feb 19, 2019, 7:25 PM Feb 19, 2019, 6:31 PM

    Hi Members,

    I want to share my experience here using MMM-AssistantMk2.
    My objective was to be able to control my Mirror with voice command eg: “Set volume to 5” to have it at 50%

    Looking at the MMM-Assistantmk2.js code I saw the transcription hook and decided to use that.
    With the help of @Sean who has developed this module, I have implemented some additional lines in the mentioned file. ( all coding credit goes to Sean ) Else the same working code would have been ugly if it was by me :)

    First in the section: transcription hook
    add

    "VOL_HOOK": {
      pattern: "set volume to ([0-9]+)",
      command: "VOL_COMMAND"
    },
    

    then lower in section command

    "VOL_COMMAND": {
      shellExec: {
        exec: "amixer sset -M 'PCM'",
        options: (params, key) => {
          return (params[1] * 10) + "%" 
        }
      },
    } 
    

    This allows me now to say “Jarvis” … “set volume to 5” then my volume will be set to 50%.

    Note that you will need to pull the last update from git to get this works as we found a bug in the code with the ‘param’ while I tried to implement that. Sean fixed that very quickly and it’s now available.

    Hope that will be useful for the community and thanks again to Sean for this great module.

    You can find the full discussion on this topic here https://github.com/eouia/MMM-AssistantMk2/issues/89

    Ej

    1 Reply Last reply Reply Quote 0
    • 1 / 1
    1 / 1
    • First post
      1/1
      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