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.2a1
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.2a1.tar.gz | 9.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ovos_simple_listener-0.3.2a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / ovos_simple_listener-0.3.2a1.tar.gz
| Download URL | ovos_simple_listener-0.3.2a1.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c08d23871a10e9aed8d2525e9a11724aa587035bcd5f4d550a5f2e93eea4bea
|
|
BLAKE2b-256 checksum How to use checksums |
1812ae7bb1119ee350c80e66c492799d9a1a95d9120c1b040b2575d90055042b
|
| 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.2a1-py3-none-any.whl
| Download URL | ovos_simple_listener-0.3.2a1-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6af0a91b1514eae95b9da68dca27e71ab4973c9ea707d0210df8b57fbb5e6d7
|
|
BLAKE2b-256 checksum How to use checksums |
f07e39d0fc36cdffe5f2168652471dcd2ca8a45761d9dd156f66c9fc468d9476
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|