felixjunghans / google_speech

Flutter google spech
MIT License
69 stars 42 forks source link

App Crashes on iOS with com.apple.coreaudio.avfaudio Exception When Using google_speech Package #62

Open Hbilalkhan22 opened 4 months ago

Hbilalkhan22 commented 4 months ago

Describe the bug I have integrated the google_speech package correctly, and it works fine on Android. However, when I run the iOS app and click on the mic button to start transcription, the app crashes immediately with the following error in Xcode:

Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: IsFormatSampleRateAndChannelCountValid(format)' First throw call stack: (0x199628f20 0x1914e2018 0x19972766c 0x1b31a0198 0x1b3202714 0x1b327c08c 0x1021ed37c 0x1021edc7c 0x1021eaac4 0x1021eb110 0x105521630 0x104f7d644 0x1022fcb98 0x1022fe7bc 0x10230ed58 0x10230e90c 0x1995fb710 0x1995f8914 0x1995f7cd8 0x1de4a81a8 0x19bc3090c 0x19bce49d0 0x100d9c918 0x1bcca9e4c) libc++abi: terminating due to uncaught exception of type NSException AVAEInternal.h:76 required condition is false: [AVAEGraphNode.mm:832:CreateRecordingTap: (IsFormatSampleRateAndChannelCountValid(format))]

I have tried different sample rates (16000, 44100, etc.), but none of them worked. The issue persists on a real device (iPhone SE 2020).

To Reproduce Steps to reproduce the behavior:

1 ) Integrate the google_speech package in a Flutter app. 2 ) Configure the sample rate and other necessary settings. 3 ) Run the app on an iOS device. 4 ) Click on the mic button to start transcription. 5 ) Observe the app crash and the error in Xcode.

Expected behavior The app should start the transcription process without crashing.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context The issue does not occur on Android; it works fine on Android devices. The problem is specific to iOS.

felixjunghans commented 3 months ago

Sorry for the late reply but are you sure that this is not a problem with the microphone or the package you are using for the recording?

Which package are you using to record the audio?