INNER CODE UNIT · Python

__init__

thevickypedia/Jarvis · jarvis/main.py:90

    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)]
        )
        logger.info("Initiating hot-word detector with sensitivity: %s", label)
        self.detector = pvporcupine.create(**constructor())
        self.audio_stream = self.open_stream()
        self.label = f"Awaiting: [{label}]"

    def open_stream(self) -> pyaudio.Stream:
        """Initializes an audio stream.

        Returns:
            pyaudio.Stream:
            Audio stream from pyaudio.
        """
        return audio_engine.open(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…