Skip to main content

ovos-core listener daemon client

Project description

OVOS Simple Listener

ovos-simple-listener is a lightweight alternative to ovos-dinkum-listener, designed for efficient wake word detection and speech recognition.

This listener provides a streamlined approach for integrating voice command capabilities into your applications using the Open Voice OS (OVOS) framework.

It was made to power hivemind-listener and hivemind-mic-satellite, but can also be used in place of ovos-dinkum-listener in your OVOS setups

at around 150 Lines of code, this repo is a good clean reference of how to use OVOS audio plugins in your own applications

Features

  • Wake Word Detection: Supports customizable wake word engines to initiate listening.
  • Voice Activity Detection (VAD): Detects silence and speech to optimize audio processing.
  • Speech Recognition: Utilizes various speech-to-text (STT) engines to transcribe audio input.
  • Callback System: Provides a flexible callback mechanism to handle state changes and processed audio.
  • Multithreading Support: Operates in a separate thread to avoid blocking the main application flow.

While this repo is lighter than ovos-dinkum-listener, it is also missing some features

  • Audio Transformers plugins
  • Continuous Listening
  • Hybrid Listening
  • Recording Mode
  • Sleep Mode
  • Multiple WakeWords

Installation

To use ovos-simple-listener, clone this repository and install the necessary dependencies. You can do this using pip:

pip install ovos-simple-listener

OVOS Usage

run ovos_simple_listener/__main__.py in place of ovos-dinkum-listener, plugins are selected from the default OVOS config ~/.config/mycroft/mycroft.conf

Library Usage

To use ovos-simple-listener, you can initialize it with the desired components (microphone, STT, VAD, and wake word) as shown in the example below:

from ovos_simple_listener import SimpleListener
from ovos_plugin_manager.microphone import OVOSMicrophoneFactory
from ovos_plugin_manager.stt import OVOSSTTFactory
from ovos_plugin_manager.vad import OVOSVADFactory
from ovos_plugin_manager.wakewords import OVOSWakeWordFactory

listener = SimpleListener(
    mic=OVOSMicrophoneFactory.create(),
    vad=OVOSVADFactory.create(),
    wakeword=OVOSWakeWordFactory.create_hotword("hey_mycroft"),
    stt=OVOSSTTFactory.create()
)

listener.run()

Callbacks

You can implement your own callbacks by extending the ListenerCallbacks class to handle events such as starting a command, ending listening, processing audio, errors, and recognizing text.

from ovos_simple_listener import ListenerCallbacks

class MyCallbacks(ListenerCallbacks):
    @classmethod
    def listen_callback(cls):
        # Handle when the listener starts processing a command
        pass

    @classmethod
    def end_listen_callback(cls):
        # Handle when the listener stops processing a command
        pass

    @classmethod
    def audio_callback(cls, audio):
        # Handle processed audio data
        pass

    @classmethod
    def error_callback(cls, audio):
        # Handle STT errors
        pass

    @classmethod
    def text_callback(cls, utterance, lang):
        # Handle recognized text
        pass

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_simple_listener-0.2.0a1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_simple_listener-0.2.0a1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file ovos_simple_listener-0.2.0a1.tar.gz.

File metadata

  • Download URL: ovos_simple_listener-0.2.0a1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ovos_simple_listener-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 a2965609efcd4d037d84470ab7da21096d5b0c203897a6e3b1730e27ef26053f
MD5 9463169aa3defac5d25492340fc49ede
BLAKE2b-256 f62c15a51db4a2c8477d5063819ebc98906aa04c79fe1c2ad5a9fef373d038c2

See more details on using hashes here.

File details

Details for the file ovos_simple_listener-0.2.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_simple_listener-0.2.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1a4c92de3355b11d9a01b729f81f6bb1192844f57d2448d7c754e920dfc151
MD5 f2c8a06e9f18a68e1fa0dd56678f0982
BLAKE2b-256 541e0fa355af01a79cb616c5e5f91afebbb13a5d4b44600e842e1f0cb49d75e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page