Mycroft AI
  • Documentation
  • About Mycroft AI
    • Why use Mycroft AI?
    • Glossary of terms
    • Contributing
    • FAQ
  • Using Mycroft AI
    • Get Mycroft
      • Mark II
        • Mark II Dev Kit
      • Mark 1
      • Picroft
      • Linux
      • Mac OS and Windows with VirtualBox
      • Docker
      • Android
    • Pairing Your Device
    • Basic Commands
    • Installing New Skills
    • Customizations
      • Configuration Manager
      • mycroft.conf
      • Languages
        • Français (French)
        • Deutsch (German)
      • Using a Custom Wake Word
      • Speech-To-Text
      • Text-To-Speech
    • Troubleshooting
      • General Troubleshooting
      • Audio Troubleshooting
      • Wake Word Troubleshooting
      • Log Files
      • Support Skill
      • Getting more support
  • Skill Development
    • Voice User Interface Design Guidelines
      • What can a Skill do?
      • Design Process
      • Voice Assistant Personas
      • Interactions
        • Intents
        • Statements and Prompts
        • Confirmations
      • Conversations
      • Error Handling
      • Example Interaction Script
      • Prototyping
      • Design to Development
    • Development Setup
      • Python Resources
      • Your First Skill
    • Skill Structure
      • Lifecycle Methods
      • Logging
      • Skill Settings
      • Dependencies
        • Manifest.yml
        • Requirements files
      • Filesystem access
      • Skill API
    • Integration Tests
      • Test Steps
      • Scenario Outlines
      • Test Runner
      • Reviewing the Report
      • Adding Custom Steps
      • Old Test System
    • User interaction
      • Intents
        • Padatious Intents
        • Adapt Intents
      • Statements
      • Prompts
      • Parsing Utterances
      • Confirmations
      • Conversational Context
      • Converse
    • Displaying information
      • GUI Framework
      • Show Simple Content
      • Mycroft-GUI on a PC
      • Mark 1 Display
    • Advanced Skill Types
      • Fallback Skill
      • Common Play Framework
      • Common Query Framework
      • Common IoT Framework
    • Mycroft Skills Manager
      • Troubleshooting
    • Marketplace Submission
      • Skills Acceptance Process
        • Information Review Template
        • Code Review Template
        • Functional Review Template
        • Combined Template
      • Skill README.md
    • FAQ
  • Mycroft Technologies
    • Technology Overview
    • Roadmap
    • Mycroft Core
      • MessageBus
      • Message Types
      • Services
        • Enclosure
        • Voice Service
        • Audio Service
        • Skills Service
      • Plugins
        • Audioservice Plugins
        • STT Plugins
        • TTS Plugins
        • Wake Word Plugins
      • Testing
      • Legacy Repo
    • Adapt
      • Adapt Examples
      • Adapt Tutorial
    • Lingua Franca
    • Mimic TTS
      • Mimic 3
      • Mimic 2
      • Mimic 1
      • Mimic Recording Studio
    • Mycroft GUI
      • Remote STT and TTS
    • Mycroft Skills Kit
    • Mycroft Skills Manager
    • Padatious
    • Precise
    • Platforms
Powered by GitBook
On this page
  • found_wake_word()
  • update()
  • stop()
  • Entry point

Was this helpful?

  1. Mycroft Technologies
  2. Mycroft Core
  3. Plugins

Wake Word Plugins

PreviousTTS PluginsNextTesting

Last updated 4 years ago

Was this helpful?

All Mycroft Wake Word Plugins need to provide a class derived from the HotWordEngine base class in mycroft.client.speech.hotword_factory

When the __init__() method of the base class is run the config for that module will be loaded and available through self.config. Mycroft's selected language will also be available through self.lang.

For example, the following :

{
  "listener": {
    "wake_word": "my wake word",
  },
  "hotwords": {
    "my wake word": {
      "module": "example_wake_word_plugin",
      "custom_attribute": "some value"
    }
  }
}

will load the "my wake word" structure from the "hotwords" section using the "example_wake_word_plugin" . The defined custom_attribute will then be available within my plugin on self.config

found_wake_word()

Each Wake Word plugin must define the found_wake_word() method taking one argument:

  • frame_data - this is the audio data that needs to be checked for a wake word. You can process audio here or return a result previously handled in the update() method.

update()

The update() method is optional and takes one argument:

  • chunk - live audio chunks allowing for streaming predictions. Results must be returned in the found_wake_word() method.

stop()

The stop() method is optional and takes no arguments. It should be used to perform any actions needed to shut down the hot word engine. This may include things such as unloading data or to shutdown external processes.

Entry point

To make the class detectable as a Wake Word plugin, the package needs to provide an entry point under the mycroft.plugin.wake_word namespace.

setup([...],
      entry_points = {'mycroft.plugin.wake_word': 'example_wake_word_plugin = my_example_ww:myWakeWordEngine'}
      )

Where:

  • example_wake_word_plugin is the Wake Word module name for the plugin

  • my_example_ww is the Python module; and

  • myWakeWordEngine is the class in the module to return

Mycroft configuration