## WebRTC Auto Gain & Noise Suppression This PR adds support for WebRTC Auto Gain and Noise Suppression as previously implemented in the Wyoming Satellite project. ### What's New Two new entities have been created a number slider for gain and another one for noise suppression. The processing happens inside of the `webrtc.py` file and is implemented in the `__main__.py` file's `process_audio` function. The slider for gain has a limit of 0-31 and noise suppression has a limit of 0-4. The Auto Gain and Noise Suppression persist through restarts and are saved as preferences. The values are dynamically chnged without needing a restart. CLI flags called `--mic-auto-gain` and `--mic-noise-suppression` have also been added. > When both values are 0, WebRTC processing is bypassed entirely with no performance overhead. Closes #25 ### Testing When saving the audio recorded by LVA there is a noticeable increase. The following two files have been recorded with similar audio being played through them with these results (Gain-31 and NS-4): | Metric | With AGC+NS | Without | |---|---|---| | Max amplitude | 0.329 | 0.054 | | RMS amplitude | 0.008905 | 0.002862 | | Volume adjustment needed | 3.034x | 13.479x | | Rough frequency | 916 Hz | 705 Hz |
134 lines
2.9 KiB
TOML
134 lines
2.9 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=62.3", "setuptools-scm>=8"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "linux-voice-assistant"
|
|
license = {text = "Apache-2.0"}
|
|
description = "Linux voice assistant for Home Assistant using the ESPHome protocol"
|
|
readme = "README.md"
|
|
authors = [
|
|
{name = "The Home Assistant Authors", email = "hello@home-assistant.io"}
|
|
]
|
|
keywords = ["home", "assistant", "voice", "esphome", "linux"]
|
|
classifiers = [
|
|
"Development Status :: 3 - Alpha",
|
|
"Intended Audience :: Developers",
|
|
"Topic :: Text Processing :: Linguistic",
|
|
"License :: OSI Approved :: Apache Software License",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
]
|
|
requires-python = ">=3.11.0"
|
|
dependencies = [
|
|
"aioesphomeapi==42.7.0",
|
|
"netifaces2==0.0.22",
|
|
"soundcard<1",
|
|
"numpy>=2,<3",
|
|
"pymicro-wakeword>=2,<3",
|
|
"pyopen-wakeword>=1,<2",
|
|
"python-mpv>=1,<2",
|
|
"zeroconf<1",
|
|
"getmac<1",
|
|
"types-protobuf",
|
|
"webrtc_noise_gain",
|
|
]
|
|
dynamic = ["version"]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"black",
|
|
"flake8",
|
|
"mypy",
|
|
"pylint",
|
|
"pytest",
|
|
"isort",
|
|
"autopep8",
|
|
]
|
|
|
|
[project.scripts]
|
|
linux-voice-assistant = "linux_voice_assistant.__main__:run"
|
|
|
|
[project.urls]
|
|
"Source Code" = "http://github.com/OHF-Voice/linux-voice-assistant"
|
|
|
|
[tool.setuptools]
|
|
platforms = ["any"]
|
|
zip-safe = true
|
|
include-package-data = true
|
|
|
|
[tool.setuptools.packages.find]
|
|
include = ["linux_voice_assistant", "linux_voice_assistant.*"]
|
|
exclude = ["tests", "tests.*"]
|
|
|
|
[tool.black]
|
|
line-length = 200
|
|
target-version = ['py312', 'py313']
|
|
include = '\.pyi?$'
|
|
exclude = '''
|
|
/(
|
|
\.eggs
|
|
| \.git
|
|
| \.hg
|
|
| \.mypy_cache
|
|
| \.tox
|
|
| \.venv
|
|
| _build
|
|
| buck-out
|
|
| build
|
|
| dist
|
|
)/
|
|
'''
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
line_length = 200
|
|
multi_line_output = 3
|
|
include_trailing_comma = true
|
|
force_grid_wrap = 0
|
|
use_parentheses = true
|
|
|
|
[tool.pylint."MESSAGES CONTROL"]
|
|
disable = [
|
|
"abstract-method",
|
|
"cyclic-import",
|
|
"duplicate-code",
|
|
"global-statement",
|
|
"import-outside-toplevel",
|
|
"inconsistent-return-statements",
|
|
"locally-disabled",
|
|
"not-context-manager",
|
|
"too-few-public-methods",
|
|
"too-many-arguments",
|
|
"too-many-branches",
|
|
"too-many-instance-attributes",
|
|
"too-many-lines",
|
|
"too-many-locals",
|
|
"too-many-public-methods",
|
|
"too-many-return-statements",
|
|
"too-many-statements",
|
|
"too-many-boolean-expressions",
|
|
"unnecessary-pass",
|
|
"unused-argument",
|
|
"broad-except",
|
|
"too-many-nested-blocks",
|
|
"invalid-name",
|
|
"unused-import",
|
|
"fixme",
|
|
"useless-super-delegation",
|
|
"missing-module-docstring",
|
|
"missing-class-docstring",
|
|
"missing-function-docstring",
|
|
"import-error",
|
|
"consider-using-with",
|
|
"R0917",
|
|
"C0301",
|
|
]
|
|
|
|
[tool.pylint."DESIGN"]
|
|
max-args = 50
|
|
|
|
[tool.pylint.format]
|
|
expected-line-ending-format = "LF"
|