This release is a pre-release and may not be stable for production use.
OVOS Simple Listener
ovos-simple-listener is a lightweight alternative to ovos-dinkum-listener. It handles wake word detection, voice activity detection (VAD), and speech-to-text (STT) transcription for the Open Voice OS (OVOS) framework.
It was built to power hivemind-listener and hivemind-mic-satellite. You can also use it in place of ovos-dinkum-listener in your OVOS setup.
At around 150 lines of code, this repo is a clean reference for how to use OVOS audio plugins in your own applications.
Features
- Wake Word Detection: supports customizable wake word engines to start listening.
- Voice Activity Detection (VAD): detects silence and speech to optimize audio processing.
- Speech Recognition: uses various speech-to-text (STT) engines to transcribe audio input.
- Callback System: gives a flexible callback mechanism to handle state changes and processed audio.
- Multithreading Support: runs in a separate thread so it does not block the main application flow.
This repo is lighter than ovos-dinkum-listener, so it is also missing some features:
- Audio Transformer plugins
- Continuous Listening
- Hybrid Listening
- Recording Mode
- Sleep Mode
- Multiple WakeWords
Installation
Install ovos-simple-listener with 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 at ~/.config/mycroft/mycroft.conf.
Library Usage
Initialize ovos-simple-listener with the components you want (microphone, STT, VAD, and wake word), as shown 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 add your own callbacks by extending the ListenerCallbacks class. Use it 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
Related Projects
- ovos-dinkum-listener: the full-featured production listener this repo is a lightweight alternative to.
- ovos-plugin-manager: supplies the microphone, STT, VAD, and wake word factories this repo uses.
- ovos-core: receives the recognized utterances this repo sends over the messagebus.
- hivemind-listener: a primary use case for this listener.
- hivemind-mic-satellite: a satellite device that uses this listener.
See docs/index.md for a full overview, and docs/architecture.md for the pipeline architecture in detail.
Contributing
Contributions are welcome. Open an issue or submit a pull request for any improvements or bug fixes.
Acknowledgements
- Open Voice OS for the framework and plugins.
License
This project is licensed under the terms in LICENSE.
Metadata
Release files for ovos-simple-listener 0.3.3a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ovos_simple_listener-0.3.3a2.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ovos_simple_listener-0.3.3a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / ovos_simple_listener-0.3.3a2.tar.gz
| Download URL | ovos_simple_listener-0.3.3a2.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2cde4c0ac8c51b61578be92e34acc91ffca92c41c6969f07182575bc611b767
|
|
BLAKE2b-256 checksum How to use checksums |
1aa976ccf5b62970ad903f4a2bdf88f6bf16193d426da56b14e08c65b9e9e16d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / ovos_simple_listener-0.3.3a2-py3-none-any.whl
| Download URL | ovos_simple_listener-0.3.3a2-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8eba5cc9a3c03a8b0766e75e7402854c58a2d175b3f1ce2e6ebf0307a69b340c
|
|
BLAKE2b-256 checksum How to use checksums |
839875d1edb89ca059318c5bfd17e239d01bfe96b792612640878d229c13e0cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|