maui
maui copied to clipboard
.NET Maui application throws System.DllNotFoundException for libMicrosoft.CognitiveServices.Speech.core.so
Description
.NET Maui application throws System.DllNotFoundException for libMicrosoft.CognitiveServices.Speech.core.so when execute SpeechSDK's methods.
Environment:
- Windows 10 Enterprise 21H2 19044.1466
- Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview Version 17.3.0 Preview 1.1
- .NET MAUI 1.0
- Microsoft.CognitiveServices.Speech v1.22
Steps to Reproduce
- Create a MAUI project
- Install Microsoft.CognitiveServices.Speech with nuget
- Add a code which call a SpeechSDK's method.
- Change the build target for Android
- Run the app.
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android12.1
Did you find any workaround?
No response
Relevant log output
No response
repro with vs main build 32609.239, here is part of output:
[monodroid-assembly] Shared library 'libMicrosoft.CognitiveServices.Speech.core.so' not loaded, p/invoke 'speech_translation_config_from_subscription' may fail
[monodroid-assembly] Shared library 'libMicrosoft.CognitiveServices.Speech.core.so' not loaded, p/invoke 'speech_translation_config_from_subscription' may fail
[ame.mauiapp770] * Assertion: should not be reached at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:456
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 1745 (Debugger agent), pid 1711 (ame.mauiapp7700)
The connection with the debugger has been lost. The target application may have exited.
Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
at Mono.Debugger.Soft.ThreadMirror.GetFrames() in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\ThreadMirror.cs:line 28
at Mono.Debugging.Soft.SoftDebuggerBacktrace..ctor(SoftDebuggerSession session, ThreadMirror thread) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerBacktrace.cs:line 64
at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet(Event[] es, Boolean dequeuing) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 2172
at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1791
I've got exactly the same issue. Are there any workarounds I can use to get this working? I'm currently completely blocked on a project I'm working on until I can find a solution.
I can get this to work on an Android emulator if I create an x86 emulator instead of an x86_64 device. I am unable to deploy a working version to my Pixel 6 pro for testing though.
@RTroywest did you find a workaround? I am also having this issue.
I guess I'm here to say... me too
Same problem here, but not only the problem is for android, other platforms have the same problem.
@felique Windows platform works for me, it's only Android that doesn't work.
@felique Windows platform works for me, it's only Android that doesn't work.
Yes, sorry I was having another problem. I can reproduce the error.. Same situation with Android, please help!
I am really surprised that this is outstanding this long. It takes the wind out of my sails for my excitement for Maui. And I'm very disappointed.
I have managed to get this building by manually linking the dependencies instead of using Nuget. I found the location of the required files in nuget and then added them into the project file:
<ItemGroup>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
I have managed to get this building by manually linking the dependencies instead of using Nuget. I found the location of the required files in nuget and then added them into the project file:
<ItemGroup> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> </ItemGroup>
Building or running? I can build with no problems using just the nuget. The problem is it will exception at runtime.
I have managed to get this building by manually linking the dependencies instead of using Nuget. I found the location of the required files in nuget and then added them into the project file:
<ItemGroup> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> <AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so"> <Abi>arm64-v8a</Abi> </AndroidNativeLibrary> </ItemGroup>
Building or running? I can build with no problems using just the nuget. The problem is it will exception at runtime.
Building and running. Everything works fine on all the android devices I've tested with once linked manually.
At runtime I get the following output in the "Output Window".
Thread started: <Thread Pool> #8
[monodroid-assembly] Shared library 'libMicrosoft.CognitiveServices.Speech.core.so' not loaded, p/invoke 'speech_config_from_subscription' may fail
[monodroid-assembly] Shared library 'libMicrosoft.CognitiveServices.Speech.core.so' not loaded, p/invoke 'speech_config_from_subscription' may fail
[TrafficStats] tagSocket(78) with statsTag=0xffffffff, statsUid=-1
**System.DllNotFoundException:** 'libMicrosoft.CognitiveServices.Speech.core.so'
Thread started: <Thread Pool> #9
[libc] Requested dump for pid 28768 (nnonfarm.client)
Notice the "Shared library 'libMicrosoft.CognitiveServices.Speech.core.so' not loaded" part. Why is it not loading?
@RTroywest hum, I must still be doing something wrong then. I am invoking code in another assembly that does reference the nuget... I wonder if I should move (or rather copy) the code temporarily and see if that will work instead.
@BobbyCannon - I had to completely remove the nuget package and reference it manually as the nuget package just wasn't worrking. I copied all the required files to a 'SpeechLibs' directory in my project and then referenced them all in the csproj file. You will need to register all of the abis you need - I've got them all registered:
<ItemGroup>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="SpeechLibs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="SpeechLibs\x86\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="SpeechLibs\x86_64\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="SpeechLibs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
</ItemGroup>
@RTroywest I have tried and tried, I cannot get the Android version to build unless I directly reference the nuget... I have to be doing something wrong. I'll have to try again this evening.
@RTroywest Could you share a small project that builds? If not, no worries. I'm just curious is all.
OK, I have it building and executing. Here is what I had to do. I'm only testing Windows and Android
I was able to include the nuget for everything but Android. I was able to use the code above but only for Android. I had to do one extra ItemGroup to reference the dll (Android Only).
so if you just remove the PackageReference to Microsoft.CognitiveServices.Speech then copy and page the config below into your Maui project file, you should also have a working solution.
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'">
<PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.23.0" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="libs\x86\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="libs\x86_64\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<Reference Include="Microsoft.CognitiveServices.Speech.csharp">
<HintPath>libs\Microsoft.CognitiveServices.Speech.csharp.dll</HintPath>
</Reference>
</ItemGroup>
@BobbyCannon @RTroywest Hi, thanks for your help I was trying to do the test without success. I am a Maui beginner and I think that I missing this step "you will need to register all of the abis you need " No idea...How to register an Abis of the DLLS?
The steps that I am doing:
-
download the plugin
-
Go to the plugin folder and copy the monoandroid\libs in a new folder named "libs"
-
Reference in the PinERP.csproj removing this:
-
<ItemGroup> <PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.23.0" /> </ItemGroup>
-
add the references that you write in the post.
@BobbyCannon @RTroywest Hi, thanks for your help I was trying to do the test without success. I am a Maui beginner and I think that I missing this step "you will need to register all of the abis you need " No idea...How to register an Abis of the DLLS?
The steps that I am doing:
- download the plugin
- Go to the plugin folder and copy the monoandroid\libs in a new folder named "libs"
- Reference in the PinERP.csproj removing this:
<ItemGroup> <PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.23.0" /> </ItemGroup>
- add the references that you write in the post.
Here is what I eventually did. I didn't want to copy the actually nugets files to my project. Later if the nuget revs, I can just find and replace the version and boom I'm upgraded.
Here is a step by step process to get it working.
- Start a Maui project.
- Open the "csproj" of the Maui project.
- Paste the code below.
- Do a find replace for "C:\Users\bobby.nuget" > "C:\Users[Your User Name].nuget"
- Build and test
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'">
<PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.23.0" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\arm64-v8a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\armeabi-v7a\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86_64\libMicrosoft.CognitiveServices.Speech.core.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.kws.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\build\monoandroid\libs\x86_64\libMicrosoft.CognitiveServices.Speech.extension.lu.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<Reference Include="Microsoft.CognitiveServices.Speech.csharp">
<HintPath>C:\Users\bobby\.nuget\packages\microsoft.cognitiveservices.speech\1.23.0\lib\monoandroid\Microsoft.CognitiveServices.Speech.csharp.dll</HintPath>
</Reference>
</ItemGroup>
@BobbyCannon, thanks very much for your guide; the android project compiles well. But I have a problem when I begin the voice Recognition.
The code:
var config = SpeechConfig.FromSubscription(Constants.CognitiveServicesApiKey, Constants.CognitiveServicesRegion); recognizer = new SpeechRecognizer(config) await recognizer.StartContinuousRecognitionAsync();
When the last line recognizer.StartContinuousRecognitionAsync() is executed I get the follow error: Error:
{System.ApplicationException: Exception with an error code: 0x15 at Microsoft.CognitiveServices.Speech.Internal.SpxExceptionThrower.ThrowIfFail(IntPtr hr) at Microsoft.CognitiveServices.Speech.Recognizer.StartContinuousRecognition() at Microsoft.CognitiveServices.Speech.Recognizer.DoAsyncRecognitionAction(Action recoImplAction) at Microsoft.CognitiveServices.Speech.SpeechRecognizer.<StartContinuousRecognitionAsync>b__52_0() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at PinERP.MainPage.OnTranscribeClicked(Object sender, EventArgs e) in D:\desarrollo\TFG\PinERP\PinERP\MainPage.xaml.cs:line 113}
I don't know if I have to add something new in Maui because my code is based on Xamarin. The windows project works well, but the android project doesn't.
Thanks again for your help.
@RTroywest, if your android project is working fine, please send me how you run the Speech service.
@felique If you'll search the error, you'll see that 0x15 is a SPXERR_MIC_ERROR. Meaning you might have permission issues and / or microphone issues?
We (Speech SDK team) are working on to update the NuGet to support .NET MAUI for Android (and also other targets). We target to provide update in the next Speech SDK release in October 2022.
Hi @jhakulin ,
Is there any update about the fix? Thanks
Hi all,
It seems that the Microsoft.CognitiveServices.Speech (1.24.0) solves the issue on Android (not tested yet on iOS).
@jonmikeli Thank you for the information! I tried it too, and it worked fine after updating Microsoft.CognitiveServices.Speech to 1.24.0.
device : Pixel 5a
Apparently, it works on Android but still having issues on iOS. Do you experience the same?
Unfortunately I don't have an ios device so I can't check that. I would appreciate it if someone could check that😊
Support for iOS and Maccatalyst has been added to 1.25.0 version of Azure Speech SDK Nuget https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech
Hi @shuheydev. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.