Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2409a4a40 | ||
|
|
2c72ad0e01 | ||
|
|
3576c0fc5f | ||
|
|
1915d3fce3 |
+1
-3
@@ -1,7 +1,5 @@
|
||||
*
|
||||
!requirements.txt
|
||||
!MANIFEST.in
|
||||
!setup.py
|
||||
!pyproject.toml
|
||||
!script/setup
|
||||
!script/run
|
||||
!wyoming_satellite/*.py
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ WORKDIR /app
|
||||
|
||||
COPY sounds/ ./sounds/
|
||||
COPY script/setup ./script/
|
||||
COPY setup.py requirements.txt MANIFEST.in ./
|
||||
COPY pyproject.toml ./
|
||||
COPY wyoming_satellite/ ./wyoming_satellite/
|
||||
|
||||
RUN script/setup
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
include requirements.txt
|
||||
include VERSION
|
||||
@@ -55,9 +55,7 @@ python3 -m venv .venv
|
||||
.venv/bin/pip3 install --upgrade wheel setuptools
|
||||
.venv/bin/pip3 install \
|
||||
-f 'https://synesthesiam.github.io/prebuilt-apps/' \
|
||||
-r requirements.txt \
|
||||
-r requirements_audio_enhancement.txt \
|
||||
-r requirements_vad.txt
|
||||
-e '.[all]'
|
||||
```
|
||||
|
||||
If the installation was successful, you should be able to run:
|
||||
|
||||
@@ -6,6 +6,7 @@ import logging
|
||||
import time
|
||||
from functools import partial
|
||||
|
||||
from pixel_ring import pixel_ring
|
||||
from wyoming.event import Event
|
||||
from wyoming.satellite import (
|
||||
SatelliteConnected,
|
||||
@@ -13,15 +14,14 @@ from wyoming.satellite import (
|
||||
StreamingStarted,
|
||||
StreamingStopped,
|
||||
)
|
||||
from wyoming.snd import Played
|
||||
from wyoming.server import AsyncEventHandler, AsyncServer
|
||||
from wyoming.snd import Played
|
||||
from wyoming.vad import VoiceStarted, VoiceStopped
|
||||
from wyoming.wake import Detection
|
||||
|
||||
from pixel_ring import pixel_ring
|
||||
|
||||
_LOGGER = logging.getLogger()
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
"""Main entry point."""
|
||||
parser = argparse.ArgumentParser()
|
||||
@@ -35,7 +35,7 @@ async def main() -> None:
|
||||
_LOGGER.info("Ready")
|
||||
|
||||
# Turn on power to LEDs
|
||||
pixel_ring.set_color_palette(0x0080ff, 0x007a37)
|
||||
pixel_ring.set_color_palette(0x0080FF, 0x007A37)
|
||||
pixel_ring.think()
|
||||
await asyncio.sleep(3)
|
||||
pixel_ring.off()
|
||||
@@ -92,10 +92,11 @@ class LEDsEventHandler(AsyncEventHandler):
|
||||
pixel_ring.off()
|
||||
elif SatelliteDisconnected.is_type(event.type):
|
||||
_LOGGER.debug("SatelliteDisconnected")
|
||||
pixel_ring.mono(0xff0000)
|
||||
pixel_ring.mono(0xFF0000)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -123,7 +123,7 @@ def apply_settings(settings: Settings) -> None:
|
||||
):
|
||||
result = run_with_gauge(
|
||||
"Installing vad...",
|
||||
[pip_install("-r", str(PROGRAM_DIR / "requirements_vad.txt"))],
|
||||
[pip_install("-e", f"{PROGRAM_DIR}[silerovad]")],
|
||||
)
|
||||
if not result:
|
||||
error("installing vad")
|
||||
@@ -135,11 +135,7 @@ def apply_settings(settings: Settings) -> None:
|
||||
):
|
||||
result = run_with_gauge(
|
||||
"Installing audio enhancements...",
|
||||
[
|
||||
pip_install(
|
||||
"-r", str(PROGRAM_DIR / "requirements_audio_enhancement.txt")
|
||||
)
|
||||
],
|
||||
[pip_install("-e", f"{PROGRAM_DIR}[webrtc]")],
|
||||
)
|
||||
if not result:
|
||||
error("installing audio enhancements")
|
||||
@@ -154,7 +150,7 @@ def apply_settings(settings: Settings) -> None:
|
||||
) and (not can_import("gpiozero", "spidev")):
|
||||
result = run_with_gauge(
|
||||
"Installing event requirements...",
|
||||
[pip_install("-r", str(PROGRAM_DIR / "requirements_respeaker.txt"))],
|
||||
[pip_install("-e", f"{PROGRAM_DIR}[respeaker]")],
|
||||
)
|
||||
if not result:
|
||||
error("installing event requirements")
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=62.3"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "wyoming_satellite"
|
||||
version = "1.3.1"
|
||||
license = {text = "MIT"}
|
||||
description = "Wyoming server for remote voice satellite"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{name = "Michael Hansen", email = "mike@rhasspy.org"}
|
||||
]
|
||||
keywords = ["rhasspy", "wyoming", "satellite"]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
]
|
||||
requires-python = ">=3.9.0"
|
||||
dependencies = [
|
||||
"wyoming==1.5.4",
|
||||
"zeroconf==0.88.0",
|
||||
"pyring-buffer>=1,<2",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
all = ["pysilero-vad==1.0.0", "webrtc-noise-gain==1.2.3"]
|
||||
silerovad = ["pysilero-vad==1.0.0"]
|
||||
webrtc = ["webrtc-noise-gain==1.2.3"]
|
||||
respeaker = ["gpiozero", "spidev"]
|
||||
dev = [
|
||||
"black==22.12.0",
|
||||
"flake8==6.0.0",
|
||||
"isort==5.11.3",
|
||||
"mypy==0.991",
|
||||
"pylint==2.15.9",
|
||||
"pytest==7.4.3",
|
||||
"pytest-asyncio==0.23.3",
|
||||
"build==1.2.2"
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
wyoming-satellite = "wyoming_satellite:__main__.run"
|
||||
|
||||
[project.urls]
|
||||
"Source Code" = "http://github.com/rhasspy/wyoming-satellite"
|
||||
|
||||
[tool.setuptools]
|
||||
platforms = ["any"]
|
||||
zip-safe = true
|
||||
include-package-data = true
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["wyoming_satellite"]
|
||||
exclude = ["tests", "tests.*"]
|
||||
@@ -1,3 +0,0 @@
|
||||
wyoming==1.5.4
|
||||
zeroconf==0.88.0
|
||||
pyring-buffer==1.0.0
|
||||
@@ -1 +0,0 @@
|
||||
webrtc-noise-gain==1.2.3
|
||||
@@ -1,7 +0,0 @@
|
||||
black==22.12.0
|
||||
flake8==6.0.0
|
||||
isort==5.11.3
|
||||
mypy==0.991
|
||||
pylint==2.15.9
|
||||
pytest==7.4.3
|
||||
pytest-asyncio==0.23.3
|
||||
@@ -1,2 +0,0 @@
|
||||
gpiozero
|
||||
spidev
|
||||
@@ -1 +0,0 @@
|
||||
pysilero-vad==1.0.0
|
||||
+1
-1
@@ -8,4 +8,4 @@ _PROGRAM_DIR = _DIR.parent
|
||||
_VENV_DIR = _PROGRAM_DIR / ".venv"
|
||||
|
||||
context = venv.EnvBuilder().ensure_directories(_VENV_DIR)
|
||||
subprocess.check_call([context.env_exe, _PROGRAM_DIR / "setup.py", "bdist_wheel"])
|
||||
subprocess.check_call([context.env_exe, "-m", "build", "--wheel", "--sdist"])
|
||||
|
||||
+3
-4
@@ -20,7 +20,6 @@ builder.create(_VENV_DIR)
|
||||
# Upgrade dependencies
|
||||
pip = [context.env_exe, "-m", "pip"]
|
||||
subprocess.check_call(pip + ["install", "--upgrade", "pip"])
|
||||
subprocess.check_call(pip + ["install", "--upgrade", "setuptools", "wheel"])
|
||||
|
||||
# Install requirements
|
||||
subprocess.check_call(
|
||||
@@ -31,13 +30,13 @@ subprocess.check_call(
|
||||
"https://www.piwheels.org/simple",
|
||||
"-f",
|
||||
"https://synesthesiam.github.io/prebuilt-apps/",
|
||||
"-r",
|
||||
str(_PROGRAM_DIR / "requirements.txt"),
|
||||
"-e",
|
||||
str(_PROGRAM_DIR),
|
||||
]
|
||||
)
|
||||
|
||||
if args.dev:
|
||||
# Install dev requirements
|
||||
subprocess.check_call(
|
||||
pip + ["install", "-r", str(_PROGRAM_DIR / "requirements_dev.txt")]
|
||||
pip + ["install", "-e", f"{_PROGRAM_DIR}[dev]"]
|
||||
)
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
import setuptools
|
||||
from setuptools import setup
|
||||
|
||||
this_dir = Path(__file__).parent
|
||||
module_dir = this_dir / "wyoming_satellite"
|
||||
version_path = module_dir / "VERSION"
|
||||
version = version_path.read_text(encoding="utf-8").strip()
|
||||
|
||||
|
||||
def get_requirements(req_path: Path) -> List[str]:
|
||||
if not req_path.is_file():
|
||||
return []
|
||||
|
||||
requirements: List[str] = []
|
||||
with open(req_path, "r", encoding="utf-8") as req_file:
|
||||
for line in req_file:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
requirements.append(line)
|
||||
|
||||
return requirements
|
||||
|
||||
|
||||
install_requires = get_requirements(this_dir / "requirements.txt")
|
||||
extras_require = {
|
||||
"silerovad": get_requirements(this_dir / "requirements_vad.txt"),
|
||||
"webrtc": get_requirements(this_dir / "requirements_audio_enhancement.txt"),
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
setup(
|
||||
name="wyoming_satellite",
|
||||
version="1.1.0",
|
||||
description="Wyoming server for remote voice satellite",
|
||||
url="http://github.com/rhasspy/wyoming-satellite",
|
||||
author="Michael Hansen",
|
||||
author_email="mike@rhasspy.org",
|
||||
packages=setuptools.find_packages(),
|
||||
package_data={
|
||||
"wyoming_satellite": [str(p.relative_to(module_dir)) for p in (version_path,)]
|
||||
},
|
||||
install_requires=install_requires,
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
],
|
||||
keywords="rhasspy wyoming satellite",
|
||||
extras_require=extras_require,
|
||||
entry_points={
|
||||
"console_scripts": ["wyoming-satellite = wyoming_satellite:__main__.run"]
|
||||
},
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
[tox]
|
||||
env_list =
|
||||
py{39,310,311}
|
||||
py{39,310,311,312,313}
|
||||
minversion = 4.12.1
|
||||
|
||||
[testenv]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
1.3.0
|
||||
@@ -1,4 +1,6 @@
|
||||
"""Voice satellite using the Wyoming protocol."""
|
||||
|
||||
import importlib.metadata
|
||||
from pathlib import Path
|
||||
|
||||
from .satellite import (
|
||||
@@ -17,7 +19,7 @@ from .settings import (
|
||||
)
|
||||
|
||||
_DIR = Path(__file__).parent
|
||||
__version__ = (_DIR / "VERSION").read_text(encoding="utf-8").strip()
|
||||
__version__ = importlib.metadata.version("wyoming-satellite")
|
||||
|
||||
__all__ = [
|
||||
"__version__",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Satellite code."""
|
||||
|
||||
import array
|
||||
import asyncio
|
||||
import logging
|
||||
@@ -514,9 +515,11 @@ class SatelliteBase:
|
||||
event = AudioChunk(
|
||||
rate=chunk.rate,
|
||||
width=chunk.width,
|
||||
channels=chunk.channels
|
||||
channels=(
|
||||
chunk.channels
|
||||
if (self.settings.mic.channel_index is None)
|
||||
else 1,
|
||||
else 1
|
||||
),
|
||||
audio=audio_bytes,
|
||||
).event()
|
||||
else:
|
||||
@@ -805,6 +808,13 @@ class SatelliteBase:
|
||||
wake_names = [w.name for w in self.settings.wake.names]
|
||||
|
||||
await self.event_to_wake(Detect(names=wake_names).event())
|
||||
await self.event_to_wake(
|
||||
AudioStart(
|
||||
rate=self.settings.mic.rate,
|
||||
width=self.settings.mic.width,
|
||||
channels=self.settings.mic.channels,
|
||||
).event()
|
||||
)
|
||||
await self.trigger_detect()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user