summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api
diff options
context:
space:
mode:
authoramanarora_09 <aman.arora9848@gmail.com>2022-07-22 15:58:23 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2022-07-28 13:58:18 +0000
commiteda84d25d819824d641cf89af1e4d61a5e946744 (patch)
tree38f4b7c34a5b91257518bcbcdc6b96d24f0641b2 /meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api
parentf206eab5753bd9ee2d5b1126c6ec5a18e75cac89 (diff)
meta-offline-voice-agent: Enable layer for offline voice recognition
- This enables offline voice recognition in AGL - Can successfully run vosk API and vosk websocket server Changes: - Create a new layer: meta-offline-voice-recognition - Create recipes for the the Vosk library, API, websocket server and model - Create feature template for the layer (agl-offline-voice-agent) - Add all required packages to IMAGE_INSTALL - ptest enable recipe python3-vosk-api - Few fixes Bug-AGL: SPEC-4497 Change-Id: Icb290ceee22e2c3a51cbd67f7431701795f1201b Signed-off-by: amanarora_09 <aman.arora9848@gmail.com>
Diffstat (limited to 'meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api')
-rw-r--r--meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/0001-Change-library-search-path-to-usr-lib.patch26
-rw-r--r--meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/run-ptest3
2 files changed, 29 insertions, 0 deletions
diff --git a/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/0001-Change-library-search-path-to-usr-lib.patch b/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/0001-Change-library-search-path-to-usr-lib.patch
new file mode 100644
index 00000000..dd4103d9
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/0001-Change-library-search-path-to-usr-lib.patch
@@ -0,0 +1,26 @@
+From 6bbf9272cb367a06a4e4f3303628075df0b51085 Mon Sep 17 00:00:00 2001
+From: amanarora_09 <aman.arora9848@gmail.com>
+Date: Fri, 22 Jul 2022 13:27:07 +0200
+Subject: [PATCH] Change library search path to /usr/lib/
+
+Make the standard location known to the python library.
+
+Signed-off-by: amanarora_09 <aman.arora9848@gmail.com>
+---
+ python/vosk/__init__.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/python/vosk/__init__.py b/python/vosk/__init__.py
+index 45e2706..d260c61 100644
+--- a/vosk/__init__.py
++++ b/vosk/__init__.py
+@@ -23,7 +23,8 @@ def open_dll():
+ os.add_dll_directory(dlldir)
+ return _ffi.dlopen(os.path.join(dlldir, "libvosk.dll"))
+ elif sys.platform == 'linux':
+- return _ffi.dlopen(os.path.join(dlldir, "libvosk.so"))
++ dlldir = os.path.abspath("/usr/lib/")
++ return _ffi.dlopen(os.path.join(dlldir, "libvosk.so.0"))
+ elif sys.platform == 'darwin':
+ return _ffi.dlopen(os.path.join(dlldir, "libvosk.dyld"))
+ else:
diff --git a/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/run-ptest b/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/run-ptest
new file mode 100644
index 00000000..567af9d7
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-python/python3-vosk/python3-vosk-api/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd tests/
+./test_simple.py test.wav