DeepSpeech
DeepSpeech copied to clipboard
.Net Standard lib in the nuget package
Will you add the .Net Standard library into nuget package?
@carlfm01 is the one expert on .Net, I have no ide what ".Net Standard Library" is, so I'll let him answer :)
Hi @verloka, thanks for the interest. As this not on my immediate work path I can't work on this right now, but would be nice to start making it easier to support other frameworks such as .NET Core with a common API, I can review if anyone wants to jump into it.
Would be very helpful to have a NetCore compatible version. Any idea of when this would be started?
@dev-bre As you can see, @carlfm01 is mostly alone on that, so any help here is welcome.
@dev-bre, @carlfm01 - The problem is that DLLImport does not see the deepspeech.so lib in the .Net Standard. DLLImport only correct works on Windows and this is a problem with the .Net Standard.
he problem is that DLLImport does not see the deepspeech.so lib in the .Net Standard.
Could you please elaborate ? Again I insist, @carlfm01 could use some help from other people that are .Net knowledgeable.
@lissyx dllimport is a built-in Windows feature, so it only works fine on Windows. Other platforms like linux or macos don't. I've ask the .net development team and they said they are working on a new modern feature to import native libraries. The problem is that the app doesn't provide enough information. Just throws FileNotFound exception.
@lissyx dllimport is a built-in Windows feature, so it only works fine on Windows. Other platforms like linux or macos don't. I've ask the .net development team and they said they are working on a new modern feature to import native libraries. The problem is that the app doesn't provide enough information. Just throws FileNotFound exception.
This is still very much unclear here, no context What app are you talking about ? How does DLLImport relates to everything ? Have you traced the system calls ? DLL search path might be wrong ? DLLImport might be lurred because we name the lib libdeepspeech.so and not libdeepspeech.dll ?
Just to clarify and avoid adding more confusion to this thread:
DllImport attribute IS supported by NetCore and would work in Linux: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute?view=netcore-3.1
Not sure why has been stated otherwise, but even the .so extension is not an issue, since the .so imports would work in Linux , the .dll imports would work in Windows. You don't need to specify the extension,you just need to specify the class name.
The not found exception might be that the lib path has not been added to env variable: LD_LIBRARY_PATH
The not found exception might be that the lib path has not been added to env variable: LD_LIBRARY_PATH
That is only valid on linux, i think the previous comment about that refers to Windows ?
You don't need to specify the extension,you just need to specify the class name
And so what happens on Windows if you name .so ?
And so what happens on Windows if you name
.so?
the name does not matter, i've experimented with different names: .dll, .so, without extension for Windows it works for Linux no
You don't need to name the extension. Windows will use the .dll , Linux the .so
[DllImport("libdeepspeech")]
In Linux you need to set the LD_ var. In Windows you need the lib available in bin folder.
You don't need to name the extension. Windows will use the .dll , Linux the .so
[DllImport("libdeepspeech")]
In Linux you need to set the LD_ var. In Windows you need the lib available in bin folder.
Does this work for you?
Not tried this for this library, but I used it in other situations My point is that if there is a problem with NetCore, it is not in the DllImport directive.
You don't need to name the extension. Windows will use the .dll , Linux the .so
Exactly my point: we currently ship it named libdeepspeech.so on Windows, if the DllImport() code tries to be clever and only loads libdeepspeech.dll that might explain why it cannot find it ...
Specifying the extension it should load the required file. Very strange it doesn't.
The extension should be automatically added only if not specified.
Doing something like: [DllImport("libdeepspeech.so")]
Should find the lib if available in the bin folder (in Windows).
Is there any update on .NetCore side? Are you guys going to look into this?
Is there any update on .NetCore side? Are you guys going to look into this?
As I already stated, .Net is maintained by only @carlfm01 and he could use some help.
I would like to help but i'm not sure how to ... I create an unofficial package and used in a demo project: https://github.com/Davilink/MyRecorder/tree/deepspeech-integration (if you want to make it work on window you need to install https://openal.org/) hoping that could help @carlfm01.
@Davilink, Have you tested on Linux?
@verloka Yeah, i tested linux and windows, i don't have a mac so cannot promise that it work on mac (it should... but not tested)
@Davilink this is great news! Thanks for this. I will spend some time in this and report back.
Would be good to have your changes merged in the main project once proved fully working.
https://github.com/mozilla/DeepSpeech/pull/3373
Just a word to mention that there's a PR in flight and we just started using GitHub Actions, so now might be a good fit for people who would like to work on the new CI to address and land this.