Closed marciovalim closed 2 years ago
i've got the same issue, looking for help.
@phonghoang2k if you find any answer, please tell me
Can you give me some details to help make this reproducible?
Please check this issue. I got all when start listening.
Thanks, I've reproduced it, looking for a cause now.
As far as I can tell something has gone wrong with the Flutter JS binding for the speech recognition API. This definitely used to work in previous Flutter versions. I just filed an issue with the Flutter team hoping they can give me some guidance. The issue is here https://github.com/flutter/flutter/issues/86621. Feel free to upvote if this is causing you problems.
For those following along here the bug has been accepted by the initial review as a regression in Flutter, see the issue linked above. If you need Web support for speech recognition currently you'll need to stick with Flutter 2.0.6 or before. I'm hopeful that a patch to the 2.2.x series will fix the regression but I have no idea how quickly regressions are addressed.
BTW https://github.com/csdcorp/speech_to_text/tree/main/multi_platform_example works with Flutter 2.2.3 in my Chrome web browser. But if I create a new flutter project and copy main.dart
and speech_main.dart
into the project and run, I got the same exception. @sowens-csd Have you tried the multi_platform_example
with Flutter 2.2.3?
Here is my flutter doctor -v
output:
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-KR)
• Flutter version 2.2.3 at /Users/abcdef/Projects/flutter/flutter
• Framework revision f4abaa0735 (4 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/abcdef/Library/Android/sdk
• Platform android-30, build-tools 29.0.3
• ANDROID_HOME = /Users/abcdef/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] VS Code (version 1.58.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.24.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.107
• No issues found!
Thanks @proddam I'm not sure what's going on, I am pretty sure I had reproduced the failure in that app previously. However, I just tried it expecting to find that it fails and I am very surprised that it worked for me as well. The only difference I can think of right now is that multi_platform_example
has a relative reference to the plugin while in a new project there is a reference to the release version on pub.dev. I'll try a dependency on the repo and see what happens there.
@sowens-csd any update?
i encountered this bug at localhost. Then i deploy and bug is fixed :))
For me it continues not working @tuanduy183
i encountered this bug at localhost. Then i deploy and bug is fixed :))
I just tried it once and nothing can be done. What is your version?
Same probleme here, a fix would be very welcome :)
Sorry folks, the issue remains open on the Flutter issue list. They seem to have identified the exact commit that introduced the problem but I see nothing that would indicate that a fix is even available in a patch yet. That's pretty bad given that the issue was identified back in July and they agreed that it's a clear regression. Because Flutter has mapped all of the speech APIs for the web they have to be the ones that resolve it.
Finally some good news on this. The Flutter team has suggested a work around for the issue. I've just committed a possible fix. This is working in the example app on Chrome. If anyone else could try this fix out in other environments and in their owns apps that would be very helpful. Once we confirm this is working I'll push an update to pub.dev.
5.3.0 is now on pub.dev. I'm going to close this, mostly so I get a feeling of accomplishment. If anyone has issues with the web please open a new issue.
TypeError: result[$item] is not a function at speech_to_text_web.SpeechToTextPlugin.new.[_onResult] (http://localhost:57473/packages/speech_to_text/speech_to_text_web.dart.lib.js:143:36) at http://localhost:57473/packages/speech_to_text/speech_to_text_web.dart.lib.js:97:98 at Object._checkAndCall (http://localhost:57473/dart_sdk.js:5246:16) at Object.dcall (http://localhost:57473/dart_sdk.js:5251:17) at SpeechRecognition. (http://localhost:57473/dart_sdk.js:100646:100)