GithubHelp home page GithubHelp logo

Comments (23)

sowens-csd avatar sowens-csd commented on August 14, 2024 2

Thanks for this report, this is really helpful. I'm going to do some research into that bind method and see what could cause failure. This at least helps localize the problem for me, thank you.

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024 1

Sorry, I missed this follow up question. Given what you had to do to enable the recognizer I'm wondering if this could be related? https://stackoverflow.com/questions/46376193/android-speechrecognizer-audio-recording-error

Can you check the suggested fix on that thread and let me know if it helps?

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024 1

The suggested fix worked. Thanks a lot for all the help! Now that we finally resolved all the problems I think these steps could be added in the documentation somewhere πŸ˜„ (it might help others as well)

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024 1

That's great news. Sorry it took so long to get there, but very happy we've resolved it. I agree that this information could be really useful. I'll add an overview to the Readme and include a link to this thread as well. Thank you for your patience and help in diagnosing the issue. It's this kind of detail work that makes plugins better. I'll leave this open until I've updated the docs.

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

Yes, it should definitely work on that device. Is there any log output with more information?

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

There was nothing that I noticed. I will post an entire log soon.

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

`PS E:\git\Flutter\stt_test> flutter run
Launching lib\main.dart on SM G930F in debug mode...
Picked up _JAVA_OPTIONS: -Xverify:none
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 6,5s
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk... 22,7s
D/FlutterActivity(23441): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(23441): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(23441): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine(23441): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@c8e9b9f) but could not find and invoke
the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate(23441): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(23441): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@c8e9b9f
D/FlutterActivityAndFragmentDelegate(23441): Executing Dart entrypoint: main, and sending initial route: /
D/libGLESv2(23441): STS_GLApi : DTS, ODTC are not allowed for Package : com.example.stt_test
D/SpeechToTextPlugin(23441): Start initialize
D/SpeechToTextPlugin(23441): Checked permission
D/SpeechToTextPlugin(23441): has permission, completing
D/SpeechToTextPlugin(23441): completeInitialize
D/SpeechToTextPlugin(23441): Creating recognizer
D/SpeechToTextPlugin(23441): Setting listener
D/SpeechToTextPlugin(23441): before setup intent
D/SpeechToTextPlugin(23441): setupRecognizerIntent
D/SpeechToTextPlugin(23441): In RecognizerIntent apply
D/SpeechToTextPlugin(23441): put model
D/SpeechToTextPlugin(23441): put package
D/SpeechToTextPlugin(23441): put partial
D/SpeechToTextPlugin(23441): after setup intent
D/SpeechToTextPlugin(23441): sending result
D/SpeechToTextPlugin(23441): leaving complete
D/SpeechToTextPlugin(23441): leaving initializeIfPermitted
E/AccessibilityBridge(23441): VirtualView node must not be the root node.
E/AccessibilityBridge(23441): VirtualView node must not be the root node.
Syncing files to device SM G930F...
D/ViewRootImpl@6d35e33MainActivity: MSG_WINDOW_FOCUS_CHANGED 0
Syncing files to device SM G930F... 8.107ms (!)

οΏ½πŸ”₯ To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R
An Observatory debugger and profiler on SM G930F is available at: http://127.0.0.1:3197/4bUypygS5mY=/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
D/ViewRootImpl@6d35e33MainActivity: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager(23441): Starting input: tba=android.view.inputmethod.EditorInfo@4cfce49 nm : com.example.stt_test ic=null
I/InputMethodManager(23441): startInputInner - mService.startInputOrWindowGainedFocus
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 1
D/SpeechToTextPlugin(23441): setupRecognizerIntent
E/SpeechRecognizer(23441): bind to recognition service failed
I/flutter (23441): SpeechToText call: notifyStatus listening
E/AccessibilityBridge(23441): VirtualView node must not be the root node.
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 1
I/flutter (23441): SpeechToText call: notifyStatus notListening
E/AccessibilityBridge(23441): VirtualView node must not be the root node.
I/zygote64(23441): Do partial code cache collection, code=30KB, data=25KB
I/zygote64(23441): After code cache collection, code=30KB, data=25KB
I/zygote64(23441): Increasing code cache capacity to 128KB
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 1
D/SpeechToTextPlugin(23441): setupRecognizerIntent
E/SpeechRecognizer(23441): bind to recognition service failed
I/flutter (23441): SpeechToText call: notifyStatus listening
E/AccessibilityBridge(23441): VirtualView node must not be the root node.
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@6d35e33MainActivity: ViewPostIme pointer 1
I/flutter (23441): SpeechToText call: notifyStatus notListening
E/AccessibilityBridge(23441): VirtualView node must not be the root node.`

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

I can see E/SpeechRecognizer(23441): bind to recognition service failed in the logs.

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

It could come from here(not sure this is the latest version of the code): https://android.googlesource.com/platform/frameworks/base.git/+/79896bd123aa3bc69c6455d4e2ddf2b2b555e6e5/core/java/android/speech/RecognitionManager.java

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

@sowens-csd Do you think this is coming from the package? Or can it be fixed in the package?

flutter/flutter#34411 (comment)

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

Some interesting content out there on this issue.

There are some SO threads that suggests a change to the Google Speech settings:
https://stackoverflow.com/questions/37607246/speechrecognizer-is-not-working-if-enhanced-google-services-is-selected
https://stackoverflow.com/questions/31986689/bind-to-recognition-service-failed, see the picture here https://i.stack.imgur.com/d1bDO.png

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

I just committed some changes that may help. There are two main approaches in this commit. The first is that the code now checks if a speech recognizer is available on the device before completing initialize. If it is not then initialization will fail with an exception. The second is that more sections of the initialization are done on the main UI thread. Some of the documentation suggests that various parts of the speech recognizer should be created on the main thread.

If you could try this version from the repo and let me know what happens that would be very helpful. I'd like the log output if it doesn't work.

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

1.0.0 is now on pub.dev with this fix. Let me know if it helps.

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

I will try the new version soon.

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

Hi @sowens-csd, thank you for all the support! Now I can see on the screen 'Speech recognition unavailable'. I will continue the investigation to see if I can find and change the SpeechRecognizer provider on my phone.

PS E:\git\Flutter\stt_test> flutter run
Launching lib\main.dart on SM G930F in debug mode...
Picked up _JAVA_OPTIONS: -Xverify:none
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 10,1s
√ Built build\app\outputs\apk\debug\app-debug.apk.
D/FlutterActivity(12878): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(12878): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(12878): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine(12878): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@f08bcc0) but could not find and invoke the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate(12878): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(12878): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@f08bcc0
D/FlutterActivityAndFragmentDelegate(12878): Executing Dart entrypoint: main, and sending initial route: /
D/SpeechToTextPlugin(12878): Start initialize
D/SpeechToTextPlugin(12878): Checked permission
D/SpeechToTextPlugin(12878): has permission, completing
D/SpeechToTextPlugin(12878): completeInitialize
D/SpeechToTextPlugin(12878): Testing recognition availability
E/SpeechToTextPlugin(12878): Speech recognition not available on this device
D/SpeechToTextPlugin(12878): leaving initializeIfPermitted
E/AccessibilityBridge(12878): VirtualView node must not be the root node.
E/flutter (12878): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(recognizerNotAvailable, Speech recognition not available on this device, )
E/flutter (12878): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (12878): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (12878):
E/flutter (12878): #2 SpeechToText.initialize (package:speech_to_text/speech_to_text.dart:164:33)
E/flutter (12878): #3 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:45:6)
E/flutter (12878): #4 SpeechToText.initialize (package:speech_to_text/speech_to_text.dart:156:26)
E/flutter (12878): #5 _MyAppState.initSpeechState (package:stt_test/main.dart:29:35)
E/flutter (12878): #6 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:45:6)
E/flutter (12878): #7 _MyAppState.initSpeechState (package:stt_test/main.dart:28:31)
E/flutter (12878): #8 _MyAppState.initState (package:stt_test/main.dart:25:5)
E/flutter (12878): #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)
E/flutter (12878): #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter (12878): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter (12878): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter (12878): #13 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1028:16)
E/flutter (12878): #14 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:999:5)
E/flutter (12878): #15 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:942:17)
E/flutter (12878): #16 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2412:19)
E/flutter (12878): #17 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:941:13)
E/flutter (12878): #18 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:819:7)
E/flutter (12878): #19 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:804:7)
E/flutter (12878): #20 _rootRun (dart:async/zone.dart:1122:38)
E/flutter (12878): #21 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (12878): #22 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (12878): #23 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:965:23)
E/flutter (12878): #24 _rootRun (dart:async/zone.dart:1126:13)
E/flutter (12878): #25 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (12878): #26 _CustomZone.bindCallback. (dart:async/zone.dart:949:23)
E/flutter (12878): #27 Timer._createTimer. (dart:async-patch/timer_patch.dart:23:15)
E/flutter (12878): #28 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
E/flutter (12878): #29 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
E/flutter (12878): #30 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
E/flutter (12878):
Syncing files to device SM G930F...
8.122ms (!)

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

I managed to activate a speech recognition provider. Here are the steps:

  1. Go to Google Play
  2. Search for 'Google'
  3. You should find this app: https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox
  4. Mine was 'Disabled' so I enabled it

This is the SO post that helped: https://stackoverflow.com/questions/28769320/how-to-check-wether-speech-recognition-is-available-or-not

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

I don't know why but now I have an error after I press the 'Start' button: error_audio_error - true

D/ViewRootImpl@7fce584MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@7fce584MainActivity: ViewPostIme pointer 1
D/SpeechToTextPlugin(23665): setupRecognizerIntent
I/flutter (23665): SpeechToText call: notifyStatus listening
I/flutter (23665): listening
E/AccessibilityBridge(23665): VirtualView node must not be the root node.
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: soundLevelChange -2.119999885559082
I/flutter (23665): SpeechToText call: notifyError {"errorMsg":"error_audio_error","permanent":true}
E/AccessibilityBridge(23665): VirtualView node must not be the root node.
D/ViewRootImpl@7fce584MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@7fce584MainActivity: ViewPostIme pointer 1
I/flutter (23665): SpeechToText call: notifyStatus notListening
I/flutter (23665): notListening
I/flutter (23665): SpeechToText call: notifyError {"errorMsg":"error_client","permanent":true}
E/AccessibilityBridge(23665): VirtualView node must not be the root node.
I/zygote64(23665): Do partial code cache collection, code=28KB, data=25KB
I/zygote64(23665): After code cache collection, code=28KB, data=25KB
I/zygote64(23665): Increasing code cache capacity to 128KB

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

@sowens-csd Do you have any idea about the new error? Could it be something with my phone?

from speech_to_text.

cristianrablau avatar cristianrablau commented on August 14, 2024

No problem @sowens-csd , keep it open as long as needed. Glad I could help!

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

Documentation issue resolved in the latest Readme.

from speech_to_text.

Tanelo avatar Tanelo commented on August 14, 2024

I've found some error running the example and after settings all mic permissions right (like provided in the installing rules). Not working on android emulator : Launching lib/main.dart on sdk gphone x86 arm in debug mode... lib/main.dart:1 βœ“ Built build/app/outputs/flutter-apk/app-debug.apk. I/OpenGLRenderer( 6584): Davey! duration=1169ms; Flags=1, IntendedVsync=1266212003476, Vsync=1266212003476, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1266224251500, AnimationStart=1266224294500, PerformTraversalsStart=1266224351500, DrawStart=1267268957500, SyncQueued=1267271314500, SyncStart=1267273870500, IssueDrawCommandsStart=1267274870500, SwapBuffers=1267319346500, FrameCompleted=1267383676500, DequeueBufferDuration=26147000, QueueBufferDuration=1357000, GpuCompleted=72904454231491230, I/Choreographer( 6584): Skipped 70 frames! The application may be doing too much work on its main thread. Connecting to VM Service at ws://127.0.0.1:54056/3MYwtnWls48=/ws I/flutter ( 6584): onStatus: listening I/flutter ( 6584): onError: SpeechRecognitionError msg: error_speech_timeout, permanent: true I/flutter ( 6584): onStatus: notListening

from speech_to_text.

Zhairgling avatar Zhairgling commented on August 14, 2024

I managed to activate a speech recognition provider. Here are the steps:

  1. Go to Google Play
  2. Search for 'Google'
  3. You should find this app: https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox
  4. Mine was 'Disabled' so I enabled it

This is the SO post that helped: https://stackoverflow.com/questions/28769320/how-to-check-wether-speech-recognition-is-available-or-not

Hi how did you install the app? I'm with a galaxy watch 4 classic and can't install the google App

from speech_to_text.

kusmayadi2022 avatar kusmayadi2022 commented on August 14, 2024

i have problem E/SpeechToTextPlugin( 3646): Speech recognition not available on this device E/flutter ( 3646): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(recognizerNotAvailable, Speech recognition not available on this device, , null).. I've built a voice-driven android app that uses the android speech recognition API. I'm currently trying to convert the app to a wear-os version. I've included the speech recognition permission in the apps manifest and have initialized the speech recognition instance the same as I have in the mobile app (which works!). The app launches well, however when I begin the speech recognition I get the following error: E/SpeechRecognizer: no selected voice recognition service

I've tested on both a physical Galaxy 4 watch, and an API 30 wear-os emulator and the problem occurs with both devices. I've installed google assistant on the devices, and google assistants voice recognition works well. I can't find and voice input / speech recognition settings on the app. I'm not sure what next steps to take in debugging this.

I want voice recognition to be detected so that it can be used on Wearos

from speech_to_text.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.