SpeechToText iOS required condition is false: IsFormatSampleRateAndChannelCountValid(format)

Open
#454 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, ios
Domain
mobile

Research direction

Start by reproducing the failure from SpeechToText.ListenAsync on both the iOS emulator and a physical phone, focusing on the IsFormatSampleRateAndChannelCountValid(format) exception and the AVAudioNode installTap stack entry. Done means identifying the audio format condition that causes the exception and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Description

Pri3

Using SpeechToText ListenAsync on iOS:

SpeechToTextResult speechToTextResult = await SpeechToText.ListenAsync(CultureInfo.CurrentCulture, new Progress<string>(partialText => { RecognitionText += partialText + " "; }), cancellationToken);

I am receiving the following error:

Objective-C exception thrown. Name: com.apple.coreaudio.avfaudio Reason: required condition is false: IsFormatSampleRateAndChannelCountValid(format)
Native stack trace:
0 CoreFoundation 0x00007ff80049b761 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff800063904 objc_exception_throw + 48
2 CoreFoundation 0x00007ff80049b56b +[NSException raise:format:] + 0
3 AVFAudio 0x00007ff846197929 _Z19AVAE_RaiseExceptionP8NSStringz + 156
4 AVFAudio 0x00007ff8461f2e90 _ZN17AUGraphNodeBaseV318CreateRecordingTapEmjP13AVAudioFormatU13block_pointerFvP16AVAudioPCMBufferP11AVAudioTimeE + 766
5 AVFAudio 0x00007ff84625f703 -[AVAudioNode installTapOnBus:bufferSize:format:block:] + 1456
6 libxamarin-dotnet-debug.dylib 0x000000010e3c5099 xamarin_dyn_objc_msgSend + 217
7 ??? 0x000000010ce5aea7 0x0 + 4511346343
8 libmonosgen-2.0.dylib 0x000000010f25b270 ves_pinvoke_method + 544
9 libmonosgen-2.0.dylib 0x000000010f24bd3c mono_interp_exec_method + 4284
10 libmonosgen-2.0.dylib 0x000000010f249383 interp_runtime_invoke + 259
11 libmonosgen-2.0.dylib 0x000000010f3307dd mono_runtime_try_invoke + 157
12 libmonosgen-2.0.dylib 0x000000010f333bae mono_runtime_invoke + 478
13 FireWatch.MobileApp 0x000000010c71a958 _ZL30native_to_managed_trampoline_9P11objc_objectP13objc_selectorPP11_MonoMethodj + 280
14 FireWatch.MobileApp 0x000000010c71b189 -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector] + 41
15 Foundation 0x00007ff800ea5790 __NSThreadPerformPerform + 178
16 CoreFoundation 0x00007ff8003f8283 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
17 CoreFoundation 0x00007ff8003f81c5 __CFRunLoopDoSource0 + 157
18 CoreFoundation 0x00007ff8003f79c2 __CFRunLoopDoSources0 + 215
19 CoreFoundation 0x00007ff8003f20f7 __CFRunLoopRun + 919
20 CoreFoundation 0x00007ff8003f197d CFRunLoopRunSpecific + 557
21 GraphicsServices 0x00007ff80fe9d08f GSEventRunModal + 137
22 UIKitCore 0x00007ff805bbb53d -[UIApplication _run] + 972
23 UIKitCore 0x00007ff805bbffab UIApplicationMain + 123
24 libxamarin-dotnet-debug.dylib 0x000000010e37f50a xamarin_UIApplicationMain + 58
25 libmonosgen-2.0.dylib 0x000000010f25c765 do_icall + 341
26 libmonosgen-2.0.dylib 0x000000010f25aef7 do_icall_wrapper + 295
27 libmonosgen-2.0.dylib 0x000000010f24bc16 mono_interp_exec_method + 3990
28 libmonosgen-2.0.dylib 0x000000010f249383 interp_runtime_invoke + 259
29 libmonosgen-2.0.dylib 0x000000010f32f6f8 mono_runtime_invoke_checked + 136
30 libmonosgen-2.0.dylib 0x000000010f33703b mono_runtime_exec_main_checked + 107
31 libmonosgen-2.0.dylib 0x000000010f19bb62 mono_jit_exec + 354
32 libxamarin-dotnet-debug.dylib 0x000000010e3c3bea xamarin_main + 1898
33 FireWatch.MobileApp 0x000000010c7b13d4 main + 68
34 dyld 0x000000010d2023e0 start_sim + 10
35 ??? 0x000000010dc87386 0x0 + 4526207878

Occurs on both the emulator and native phone. Any ideas what could be causing this?

Dominant language
No language data
Stars
168
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MicrosoftDocs/CommunityToolkit

All issues in MicrosoftDocs/CommunityToolkit

Similar issues

More Mobile Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.