Ich kann meine Android -App nicht dazu bringen, mit Vosk in macOS12.7 zu arbeitenPython

Python-Programme
Anonymous
 Ich kann meine Android -App nicht dazu bringen, mit Vosk in macOS12.7 zu arbeiten

Post by Anonymous »

Ich habe den Wringer durchgemacht, der versucht hat, Spracherkennung für eine Android -App zu erhalten, die ich auf meinem MacOS 12.7 entwickelte, indem ich Python3.10, Kivy2.3, Rede -Erkognitionserfordernis und Vosk 3.44, ich habe Buildozer ganz gut mit anderen Versionen verwendet und Apps verwendet. Ich habe das größte Problem auf Andoriden Selinux Security eingeschränkt. Ohne einen unabhängigen FLAC oder irgendetwas für mich selbst zu kompilieren (was ein bisschen mehr ist). Ich würde gerne Vosk verwenden. Hier ist eine Zusammenfassung meiner Informationen: < /p>
buildozer 1.5

Kivy 2.3

Python 3.10

vosk 3.44

macos 12.7 < /p>

04-06 13:07:00.558 15767 15943 I python : DEBUG: Attempting standard Vosk import...
04-06 13:07:00.560 15767 15943 I python : ERROR: Standard Vosk library import failed: No module named 'srt'.
04-06 13:07:00.560 15767 15943 I python : INFO: Ensure 'vosk' is in buildozer.spec requirements and the recipe ran successfully.
04-06 13:07:00.561 15767 15943 I python : DEBUG: Attempting JNIUS/Android imports...
04-06 13:07:00.659 15767 15943 I python : DEBUG: JNIUS/Android imports successful.
04-06 13:07:00.659 15767 15943 I python : INFO: Starting AbbotApp application (__main__ block).
04-06 13:07:00.659 15767 15943 I python : DEBUG: Adding project directory to resource path: /data/data/abbot.abby/files/app
04-06 13:07:00.659 15767 15943 I python : DEBUG: Adding asset directory 'model' to resource path: /data/data/abbot.abby/files/app/model
04-06 13:07:00.659 15767 15943 I python : INFO: Creating and running AbbotApp instance...
04-06 13:07:00.660 15767 15943 I python : DEBUG: AbbotApp.__init__ starting.
04-06 13:07:00.660 15767 15943 I python : DEBUG: BibleData.__init__ called with bible_file='asvbible.txt'
04-06 13:07:00.660 15767 15943 I python : DEBUG: Found bible file at: /data/data/abbot.abby/files/app/asvbible.txt
04-06 13:07:00.660 15767 15943 I python : DEBUG: Loading Bible data from: /data/data/abbot.abby/files/app/asvbible.txt
04-06 13:07:00.876 15767 15943 I python : DEBUG: Finished loading bible data. 66 books loaded.
04-06 13:07:00.876 15767 15943 I python : DEBUG: Building list of all verses...
04-06 13:07:00.908 15767 15943 I python : DEBUG: Built 31086 verses.
04-06 13:07:00.908 15767 15943 I python : DEBUG: Bible data loaded successfully. 31086 total verses.
04-06 13:07:00.908 15767 15943 I python : DEBUG: AbbotApp.__init__ checking permissions.
04-06 13:07:00.908 15767 15943 I python : DEBUG: check_and_request_permissions called.
04-06 13:07:00.912 15767 15943 I python : INFO: All required permissions already granted.
04-06 13:07:00.912 15767 15943 I python : DEBUG: AbbotApp.__init__ finished.
04-06 13:07:00.913 15767 15943 I python : DEBUG: AbbotApp.build() called.
04-06 13:07:01.011 15767 15943 I python : [INFO ] [GL ] NPOT texture support is available
04-06 13:07:01.052 15767 15943 I python : DEBUG: AbbotApp.build() finished.
04-06 13:07:01.053 15767 15943 I python : INFO: AbbotApp.on_start() called.
04-06 13:07:01.053 15767 15943 I python : INFO: Triggering Vosk model setup from on_start.
04-06 13:07:01.053 15767 15943 I python : INFO: AbbotApp.on_start() finished.
04-06 13:07:01.054 15767 15943 I python : [WARNING] [Base ] Unknown provider

***** mostly here:

04-06 13:07:01.054 15767 15943 I python : [INFO ] [Base ] Start application main loop
04-06 13:07:01.075 15767 15943 I python : DEBUG: setup_vosk_model called.
04-06 13:07:01.075 15767 15943 I python : ERROR: Vosk library components (Model/KaldiRecognizer/SetLogLevel) are None due to import failure. Cannot setup model.
----------------------------------------------------------------------------------------
the buildozer has the model directory, and it is built into the Python App to import it (correctly, within the called directory, and file *.so, among a couple of others)
----------------------------------------------------------------------------------------
< /code>
Teil meines Buildozer.spec -Datei: < /p>

Code: Select all

requirements = python3,python-for-android,kivy,pydub,speechrecognition,plyer,pyjnius,jnius,sdl2,sdl2_image,cython
(Ich habe auch versucht, variiert/viele Möglichkeiten, einschließlich der tatsächlichen Versionen in der Anforderungen Liste - ohne Erfolg) ..
android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE, RECORD_AUDIO, READ_EXTERNAL_STORAGE

ETC..
----------------------------------------------------------------------------------------
< /code>
Hier ist die (Cutdown) -Version meiner Buildozer.spec -Datei für diese App: < /p>
[app]

# (str) Title of your application
title = ABBot2App

# (str) Package name
package.name = abby

# (str) Package domain (needed for android/ios packaging)
package.domain = abbot

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
# ***
source.include_exts = py,png,txt,jpg,kv,atlas,ffmpeg,ffprobe,flac

# (list) List of inclusions using pattern matching
source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec,upload.py

# (list) List of directory to exclude (let empty to not exclude anything)
source.exclude_dirs = test, bin, venv, bu, tryit, NDK

# (list) List of exclusions using pattern matching
# Do not prefix with './'
#source.exclude_patterns = license,images/*/*.jpg
source.exclude_patterns = release_docs.py

# (str) Application versioning (method 1)
version = 0.2

android.gradle_dependencies = com.android.support:appcompat-v7:28.0.0, com.android.support:design:28.0.0, com.google.android.material:material:1.0.0

#requirements = #python3==3.10.15,python-for-android==2024.1.21,kivy==2.3.0,pydub==0.25.1,speechrecognition==3.11.0,plyer,pyjnius,jnius==1.5.0,sdl2,sdl2_image#,cython==3.0.125

requirements = python3,python-for-android,kivy,pydub,speechrecognition,plyer,pyjnius,jnius,sdl2,sdl2_image,cython

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png
icon.filename = ./abbyimg.png

# (list) Supported orientations
# Valid options are: landscape, portrait, portrait-reverse or landscape-reverse
orientation = portrait

# change the major version of python used by the app
osx.python_version = 3.10.15

# Kivy version to use
osx.kivy_version = 2.3.0

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 1

android.presplash_color = #555555

android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE, RECORD_AUDIO, READ_EXTERNAL_STORAGE

# (int) Target Android API, should be as high as possible.
#31
android.api = 36

# (int) Minimum API your APK / AAB will support.
#21
android.minapi = 27

# (int) Android SDK version to use
#android.sdk = 20 #deprecaded and ignored

# (str) Android NDK version to use
#25
android.ndk = 27

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#21
android.ndk_api = 27

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = False

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = /Users/garrett/Library/Android/sdk/ndk/android-ndk-r27
#android.ndk_path = /users/garrett/Library/Android/sdk/ndk/21.4.7075529

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
android.sdk_path = /Users/garrett/Library/Android/sdk

# (str) ANT directory (if empty, it will be automatically downloaded.)
android.ant_path = /Users/garrett/.buildozer/android/platform/apache-ant-1.9.4

android.jdk_path = /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
android.skip_update = False

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
android.accept_sdk_license = True

android.gradle_max_heap_size = 4092m

# (list) Gradle dependencies to add
#android.gradle_dependencies =

# (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies'
# contains an 'androidx' package, or any package from Kotlin source.
# android.enable_androidx requires android.api >= 28
android.enable_androidx = True

android.manifest.orientation = portrait

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so

# ***
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
android.add_libs_arm64_v8a = libs/android-v8/*.so

# (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
# In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time.
android.archs = arm64-v8a
#,armeabi-v7a

# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True

# (str) python-for-android branch to use, defaults to master
# ***
p4a.branch = master

# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
# ***
p4a.commit = HEAD

# (str) The directory in which python-for-android should look for your own build recipes (if any)
# ***
p4a.local_recipes = ./p4a-recipes

# (str) Filename to the hook for p4a
# ***
p4a.hook = post-build-hook.py

# (str) Bootstrap to use for android builds
# ***
p4a.bootstrap = sdl2

[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
< /code>

Die andere "Warnung", die ich erhalte, ist in meiner App, wenn ich sie lade, heißt es einfach, dass der VOSK -Bibliothek import fehlgeschlagen ist < /code> .. das wird in meine main.py -Datei codiert. < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post