Closed kakobayashi closed 1 month ago
Thanks for the very thorough problem report. That's an interesting issue. I wonder if I'm leaking channels.
Thank you for your reply.
My application includes the record package.
I will add the logs in my app and check it. I am also asking the user who is getting this error.
I have tried my iPhone15 Pro and could not get it to occur. However, I can confirm that it is occurring on the iPhone15 Pro on Crashlytics. I don't think it is a device issue.
Here is what I have tried to do
The error did not change when AudioSession was regenerated when channelCount was 0, as shown below. https://github.com/kakobayashi/speech_to_text/blob/v6.4.1/autoPunctuation/speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift#L397
I have removed the "Not enough available inputs." error throw process so that the details of the error can be checked on the Flutter side, as shown below. https://github.com/kakobayashi/speech_to_text/blob/v6.4.1/autoPunctuation_v4/speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift#L451-L452
I have checked the following logs
SpeechRecognitionError msg: error_listen_failed, permanent: true, detail: Error Domain=Try Code=1 "(null)" UserInfo={exception=required condition is false: IsFormatSampleRateAndChannelCountValid(hwFormat)} 0 48000.0
The audioSession.sampleRate
was confirmed only at 48000.
I have confirmed over 100 cases at 48000, but not occurring at other times.
I tried setting sampleRate
to 48000 as shown below, but this did not fix this error.
await _speechToText.listen(
localeId: localeId,
listenMode: ListenMode.dictation,
onDevice: false,
onResult: onResult,
sampleRate: 48000, // add
);
My first thought, since you're also using the record package in the app, is that the microphone is in use at the time STT is trying to install the tap. I don't know whether in your app it would be possible for the user to not enable or at least not use the record functionality and see if they can still reproduce the issue? If not perhaps you could get them on TestFlight and get them a version that allows for that test?
I can ask the user who is experiencing this error to test the app without the record package for testing. I will try to distribute the app to this user on TestFlight.
Thank you.
I distributed the app on TestFlight with the Record package removed. However, that app is getting the same error. I would like to know if you have any other thoughts.
This error was occurring when the interstitial ads were not disposed properly. Thank you very much.
Thank you for providing us with a great package.
I have confirmed with Crashlytics that the
error_listen_failed
error may occur.Device information
Flutter version
I'm in trouble understanding the cause of this error. I have forked this package, so I can log it into SwiftSpeechToTextPlugin.swift and provide the information.
Thank you.