Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for configuring hotwords #76

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 69 additions & 5 deletions docs/ht_ww.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,54 @@
# OVOS Listener - WakeWords / HotWords
OVOS uses "wakewords" to activate the system. This is what "hey Google" or "Alexa" is on proprietary devices. By default, OVOS uses the WakeWord "hey Mycroft".
OVOS uses "WakeWords" to activate the system. This is what "hey Google" or "Alexa" is on proprietary devices. By default, OVOS uses the WakeWord "hey Mycroft".

In OVOS, a WakeWord is configured in the hotwords section of the user's mycroft.conf configuration (defaults to `~/.config/mycroft/mycroft.conf`). Multiple "hotwords" can be configured at one time. They can trigger a variety of tasks, ranging from putting OVOS into active listening mode (the default for "hey Mycroft") to issuing a command such as "stop" or "wake up."

Each hotword can do one or more of the following (with example configs):
* trigger listening, also called a wake_word (default option)
* `"listen" : true`

* play a sound. You can set a specific sound per hotword.
* `"sound": "snd/start_listening.wav"`


* emit an utterance to open a skill directly (instead of listen), useful to open skills from others.
* `"utterance” : "What’s the time"`
* `"listen” : false`

This example will start the date & time skill with the given utterance and not listen for a command.

* emit a bus event directly to the messagebus, to for instance open a skill you developed yourself (instead of listen / utterance), emit a message directly (microphone mute/unmute"
* `"bus_event" : "custom.message.that.you.use.in.your.own.skill"`

or

* `"bus_event" : "mycroft.mic.mute"`

* Use a hotkey. This allows you to assign a keyboard shortcut (e.g., "ctrl+alt+h") for triggering the hotword manually. The [ovos-ww-plugin-hotkeys](https://github.com/OpenVoiceOS/ovos-ww-plugin-hotkeys) is required for using a hotkey.
* `"hotkey": "control+shift+h"`

* assign a language for STT per wake word
* `"stt_lang": "pt-pt"` (at Speech To Text stage the language code, for example `pt-pt`, will be requested instead of the global language.

* be a wakeup word (out of sleep mode); take ovos-core out of sleep mode, also called a wakeup_word or standup_word
* Example:
```
"listener": {
// Default wake_word and stand_up_word will be automatically set to active
// unless explicitly disabled under "hotwords" section with "active": false. This is usually not
desired unless you are looking to completely disable wake word usage
"wake_word": "hey mycroft",
"stand_up_word": "wake up"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for @JarbasAl confirmation that this syntax works as a wake word

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, Jarbas should review this one because of what it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under the "listener" section you specify the default wake_word and stand_up_word

these will be automatically set active: true (unless you override it in the individual config of each word)

in single wake word mode you never set active flag in each definition, you only change this value. when using a backend for example this is the only thing that changes

Copy link
Author

@timonvanhasselt timonvanhasselt Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a part I don't understand tbh, the difference between wake(up?)word and stand_up word as a hotword config.
So, I don't think my interpretation is helpful here, sorry. I've copied the comments text from the technical manual or the dinkum listener (If I recall correctly).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wake_word -> start listening, "hey mycroft"
stand_up_word -> come out of sleep mode , default to "wake up"

Copy link
Author

@timonvanhasselt timonvanhasselt Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JarbasAl So If I understand correctly:

Hey Mycroft is standard wake word (configured in listener). But if I would like to have 'Hey Ziggy', as an extra wake word, that triggers a certain action, then I define 'Hey Ziggy' as a hotword and set it to active.

I think a complete example config (of listener + hotword sections) with a standard WW and extra hotwords would help a lot! Then we can explain the config and what every hotword do... Like your snowboy/ "self destruct video", that was for me an eyeopener that this configs were possible at all! I know the video is old, but it would help 'simple' users as me a lot :)

}
```
See: [skill-ovos-naptime](https://github.com/OpenVoiceOS/skill-ovos-naptime)


* Take ovos-core out of recording mode, also called a `stop_word`
* A stop word is used when using a record skill like
[skill-audio-recordinge](https://github.com/NeonGeckoCom/skill-audio-recording)

OVOS "hotwords" is the configuration section to specify what the WakeWord do. Multiple "hotwords" can be used to do a variety of things from putting OVOS into active listening mode, a WakeWord like "hey Mycroft", to issuing a command such as "stop" or "wake up"

As with everything else, this too can be changed, and several plugins are available. Some work better than others.

## List of OVOS WakeWord Plugins
| Plugin | Type | Description |
Expand Down Expand Up @@ -50,12 +95,31 @@ The most important section is `"wake_word": "hey_ziggy"` in the `"listener"` sec

This tells OVOS what the default wakeword should be.

In the `"hotwords"` section, `"active": true`, is only used if multiple wakewords are being used. By default, what ever `wake_word` is set in the `listener` section is automatically set to `true`.
In the `"hotwords"` section, `"active": true`, is only used if multiple wakewords are being used. By default, what ever `wake_word` is set in the `listener` section is automatically set to `true`.

If you want to disable a wakeword, you can set this to `false`.

If enabling a wakeword, be sure to also set `"listen": true`.

Multiple hotwords can be configured at the same time, even the same word with different plugins. This allows for more accurate ones to be used before the less accurate, but only if the plugin is installed.
Multiple hotwords can be configured at the same time, even the same word with different plugins. This allows for more accurate ones to be used before the less accurate, but only if the plugin is installed.


## Example hotword config (keyboard wakeword)
In the following example an extra hotword is added, that uses the [ovos-ww-plugin-hotkeys](https://github.com/OpenVoiceOS/ovos-ww-plugin-hotkeys) to listen for keyboard press and start a skill based on an utterance (in this example to tell the time by just pressing space bar).
Install the [ovos-ww-plugin-hotkeys](https://github.com/OpenVoiceOS/ovos-ww-plugin-hotkeys) and add the following to your `~/.config/mycroft/mycroft.conf` file

```
"hotwords": {
"hotkey": {
"module": "ovos_ww_hotkeys",
"listen": false,
"active": true,
"hotkey": "space",
"utterance": "what time is it?"
}
}
```

## Read more about WakeWords/HotWords

[Advanced WakeWords/HotWords](https://openvoiceos.github.io/ovos-technical-manual/ww_plugins/)