alphacep / alphacep/vosk-api

Problem access the vosk API ".dll" and ".so" with Delphi 11.2 under Windows 11.

Aperta
#1,736 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
15.1k
Fork
1.8k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello,
I can't access the vosk API "libvosk.dll" with Delphi 11.2 under Windows 11.
The problem is the same with the ".so" library for compiling to Android with Delphi.
The access tests to the DLL (vosk_model_new) are OK in C under VSCode.
Question: Is the Windows DLL (et.so) library configured in the stdcall required for Delphi?
Do you have any other ideas, or is it possible to modify the library ".dll" and ".so" repo for program delphi/Windows?
Thanks.

===========================================
The Delphi header unit "vosk_api.pas":
(compilation/linking are fine, but the call to "vosk_model_new" is always = nil)
I created an intermediate DLL to correct, if necessary, a problem converting pansichar
to a string "0terminal", but the result is also negative.

```
unit vosk_api;
{ This unit is automatically generated by Chet:
https://github.com/neslib/Chet }

{$MINENUMSIZE 4}

interface

const
{$IF Defined(WIN32)}
LIB_VOSK = 'libvosk.dll';
_PU = '';
{$ELSEIF Defined(WIN64)}
LIB_VOSK = 'libvosk.dll';
_PU = '';
{$ELSE}
{$MESSAGE Error 'Unsupported platform'}
{$IFEND}

type
PVoskModel = Pointer;
PPVoskModel = ^PVoskModel;
PVoskSpkModel = Pointer;
PPVoskSpkModel = ^PVoskSpkModel;
PVoskRecognizer = Pointer;
PPVoskRecognizer = ^PVoskRecognizer;
PVoskBatchModel = Pointer;
PPVoskBatchModel = ^PVoskBatchModel;
PVoskBatchRecognizer = Pointer;
PPVoskBatchRecognizer = ^PVoskBatchRecognizer;

(** Loads model data from the file and returns the model object
*
* @param model_path: the path of the model on the filesystem
* @returns model object or NULL if problem occured *)
function vosk_model_new(const model_path: PAnsiChar): PVoskModel; cdecl;
external LIB_VOSK name _PU + 'vosk_model_new';
...
```
==========================================
le contenu de la dll:
```
D:\Outils\Dev\vosk\vosk-win64-0.3.45>dir
Le volume dans le lecteur D s’appelle DATA
Le numéro de série du volume est 7095-7215

Répertoire de D:\Outils\Dev\vosk\vosk-win64-0.3.45

11/03/2025 17:59 .
26/03/2025 12:02 ..
11/03/2025 17:59 606 425 libgcc_s_seh-1.dll
11/03/2025 17:59 26 619 146 libstdc++-6.dll
11/03/2025 17:59 26 447 872 libvosk.dll
11/03/2025 17:59 16 230 308 libvosk.lib
11/03/2025 17:59 366 907 libwinpthread-1.dll
11/03/2025 17:59 12 445 vosk_api.h
6 fichier(s) 70 283 103 octets
2 Rép(s) 461 917 831 168 octets libres

D:\Outils\Dev\vosk\vosk-win64-0.3.45>nm libvosk.dll
nm: libvosk.dll: no symbols

D:\Outils\Dev\vosk\vosk-win64-0.3.45>
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.