Skip to main content

Jarvis UI to perform voice commands via API calls

Project description

Python

Deployments

pages-build-deployment

pypi

Jarvis UI

Connects to Jarvis running in the backend to process request and response via API calls.

Kick off

Install

python -m pip install jarvis-ui

Initiate

import jarvis_ui


if __name__ == '__main__':
    jarvis_ui.start()

Environment Variables

Env vars are loaded from a .env file and validated using pydantic

To use custom .env files

To use a custom .env file, set the filename to the env var env_file before importing jarvis_ui module.

import os
os.environ['env_file'] = "jarvis_ui.env"

import jarvis_ui

if __name__ == '__main__':
    jarvis_ui.start()

Mandatory

  • SERVER_URL: Endpoint URL to which the API call has to be made. Can be localhost or a tunneled URL behind a reverse proxy/CDN.
  • TOKEN: Authentication token.

Optional

  • HEART_BEAT: Defaults to None - Interval in seconds to trigger background healthcheck on the server with automatic restart
  • DEBUG: Defaults to False - Enable debug level logging

  • SPEECH_TIMEOUT: Defaults to 0 for macOS, 10 for Windows - Timeout for speech synthesis

  • NATIVE_AUDIO: Defaults to False - If set to True, the response is generated in the server's default voice
  • WAKE_WORDS: Defaults to jarvis (Defaults to alexa in macOS older than 10.14) - Wake words to initiate Jarvis
  • SENSITIVITY: Defaults to 0.5 - Sensitivity of wake word detection

  • MICROPHONE_INDEX: Defaults to None - Use peripherals.py to get the index values
  • VOICE_NAME: Defaults to the author's favorite per the OS. Name of the voice supported by the OperatingSystem
  • VOICE_RATE: Defaults to the value in py3-tts module - Speed/rate at which the text should be spoken
  • VOICE_PITCH: Defaults to the value in py3-tts module - Currently available only for Linux OS

  • LISTENER_TIMEOUT: Defaults to 2 - Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit
  • LISTENER_PHRASE_LIMIT: Defaults to 5 - Timeout for phrase once listener is activated - Listener will be deactivated after this limit
  • RECOGNIZER_SETTINGS: JSON object of customized speech recognition settings.
Custom settings for speech recognition

The default values for RECOGNIZER_SETTINGS are customized according to the author's voice pitch. Please use test_listener.py to figure out the suitable values in a trial and error method.

Sample settings (formatted as JSON object)

RECOGNIZER_SETTINGS: '{"energy_threshold": 1100, "dynamic_energy_threshold": false, "pause_threshold": 1, "phrase_threshold": 0.1}'

Description

  • energy_threshold: Minimum audio energy to consider for recording. Greater the value, louder the voice should be.
  • dynamic_energy_threshold: Change considerable audio energy_threshold dynamically.
  • pause_threshold: Seconds of non-speaking audio before a phrase is considered complete.
  • phrase_threshold: Minimum seconds of speaking audio before it can be considered a phrase - values below this are ignored. This helps to filter out clicks and pops.
  • non_speaking_duration: Seconds of non-speaking audio to keep on both sides of the recording.

:bulb:   Refer Jarvis' README for more information on setting up the backend server.

Coding Standards

Docstring format: Google
Styling conventions: PEP 8
Clean code with pre-commit hooks: flake8 and isort

Release Notes

Requirement

python -m pip install gitverse

Usage

gitverse-release reverse -f release_notes.rst -t 'Release Notes'

Linting

PreCommit will ensure linting, and the doc creation are run on every commit.

Requirement

python -m pip install sphinx==5.1.1 pre-commit recommonmark

Usage

pre-commit run --all-files

Pypi Package

pypi-module

https://pypi.org/project/jarvis-ui/

Runbook

made-with-sphinx-doc

https://thevickypedia.github.io/Jarvis_UI/

License & copyright

© Vignesh Rao

Licensed under the MIT License

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

jarvis_ui-2.3.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file jarvis_ui-2.3.1-py3-none-any.whl.

File metadata

  • Download URL: jarvis_ui-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for jarvis_ui-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d52cba073e428d7749c6caca7d06a2b10138c3a2eada15f97ce74e7036caaa94
MD5 9648caf5d5b648fc15e15e032d9821ab
BLAKE2b-256 f6091b0280c1061b143b30171a8744cefd3b119962426b0bb31c2b9704d83b39

See more details on using hashes here.

Supported by

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