about summary refs log tree commit diff
path: root/pkgs/tools/audio/wyoming
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-09-27 05:51:13 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-09-30 03:31:13 +0200
commit2f8cdd29fe077b3d2676d4437a47f1c00e6b1b0d (patch)
tree2d466283483b6c1ce0d17907c4a2f98adc66b907 /pkgs/tools/audio/wyoming
parente75579e566709d3adaa52e72015fd9522dfc435a (diff)
wyoming-openwakeword: init at 1.5.1
Wyoming server for the openWakeWord library.
Diffstat (limited to 'pkgs/tools/audio/wyoming')
-rw-r--r--pkgs/tools/audio/wyoming/openwakeword.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/tools/audio/wyoming/openwakeword.nix b/pkgs/tools/audio/wyoming/openwakeword.nix
new file mode 100644
index 0000000000000..d8450dac69830
--- /dev/null
+++ b/pkgs/tools/audio/wyoming/openwakeword.nix
@@ -0,0 +1,63 @@
+{ lib
+, python3
+, python3Packages
+, fetchFromGitHub
+, fetchpatch
+}:
+
+python3.pkgs.buildPythonApplication {
+  pname = "wyoming-openwakeword";
+  version = "1.5.1";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "rhasspy";
+    repo = "rhasspy3";
+    rev = "e16d7d374a64f671db48142c7b635b327660ebcf";
+    hash = "sha256-SbWsRmR1hfuU3yJbuu+r7M43ugHeNwLgu5S8MqkbCQA=";
+  };
+
+  patches = [
+    (fetchpatch {
+      # import tflite entrypoint from tensorflow
+      url = "https://github.com/rhasspy/rhasspy3/commit/23b1bc9cf1e9aa78453feb11e27d5dafe26de068.patch";
+      hash = "sha256-fjLJ+VI4c8ABBWx1IjZ6nS8MGqdry4rgcThKiaAvz+Q=";
+    })
+    (fetchpatch {
+      # add commandline entrypoint
+      url = "https://github.com/rhasspy/rhasspy3/commit/7662b82cd85e16817a3c6f4153e855bf57436ac3.patch";
+      hash = "sha256-41CLkVDSAJJpZ5irwIf/Z4wHoCuKDrqFBAjKCx7ta50=";
+    })
+  ];
+
+  postPatch = ''
+    cd programs/wake/openwakeword-lite/server
+  '';
+
+  nativeBuildInputs = with python3Packages; [
+    setuptools
+    wheel
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    tensorflow-bin
+    webrtc-noise-gain
+    wyoming
+  ];
+
+  passthru.optional-dependencies.webrtc = with python3Packages; [
+    webrtc-noise-gain
+  ];
+
+  pythonImportsCheck = [
+    "wyoming_openwakeword"
+  ];
+
+  meta = with lib; {
+    description = "An open source voice assistant toolkit for many human languages";
+    homepage = "https://github.com/rhasspy/rhasspy3/commit/fe44635132079db74d0c76c6b3553b842aa1e318";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+    mainProgram = "wyoming-openwakeword";
+  };
+}