INNER CODE UNIT · Python
Activator
thevickypedia/Jarvis · jarvis/main.py:76
class Activator:
"""Awaits for the keyword ``Jarvis`` and triggers ``initiator`` when heard.
>>> Activator
See Also:
- Instantiates an instance of Porcupine object and monitors audio stream for occurrences of keywords.
- A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
- sensitivity: Tolerance/Sensitivity level. Takes argument or env var ``sensitivity`` or defaults to ``0.5``
References:
- `Audio Overflow <https://people.csail.mit.edu/hubert/pyaudio/docs/#pyaudio.Stream.read>`__ handling.
"""
def __init__(self):
"""Initiates Porcupine object for hot word detection."""
label = ", ".join(
[f"{string.capwords(wake)!r}: {sens}" for wake, sens in zip(models.env.wake_words, models.env.sensitivity)]