Closed alexrabin-sentracam closed 3 months ago
@sowens-csd I was able to implement macOS support by using the shared Darwin approach as mentioned in the flutter docs: https://docs.flutter.dev/packages-and-plugins/developing-packages#shared-ios-and-macos-implementations. Both iOS and macOS use the same code with some slight differences based off their platforms.
Take a look at the speech_to_text/darwin/Classes/SpeechToTextPlugin.swift file for the implementation.
@sowens-csd any plans to merge and launch it in a new version of the flutter package?
Are you aware of speech_to_text_macos?
@alibad "speech_to_text_macos" is no longer needed because of the shared darwin implementation in this pr
@alibad I ran the example projects on iOS and macOS on my Mac. I made sure text was returned from the plugin.
@sowens-csd can you please approve this change? I'd like to use it as soon as the new version comes out.
@alexrabin-sentracam I've merged the PR and am trying to run the example on MacOS. I've tried it from Xcode after a clean build and the app appears but clicking initialize does not appear to do anything. No errors in the log.
So far I've been unable to get the debugger to stop on any lines inside the .swift. Any tips on how you tested that might help?
@sowens-csd I pulled the latest code and I was able to get it to work correctly in Xcode. What macOS version are you on? I am on macOS 14.5
@sowens-csd make sure to run
flutter pub get
and cd macos && pod install
It's possible your local is still pointing to the old speech_to_text_macos plugin
Thanks for the assist, working well now. I'll add that to the README in case anyone is as much of an idiot as I. Thanks so much for doing this work. It's going to be in the 7.0.0 release of the plugin.
Happy to help!
Exciting! @sowens-csd when will the 7.0.0 release of the plugin take place? I'd like to pull it right away to test the MacOS behavior.
7.0.0-beta.1 is available now.
I just tested the beta. Before, I would get an initialize error. Now, the app crashes without any errors logged
Did you run it from Xcode or VSCode? There's apparently a permissions problem that prevent Mac apps from working unless run from Xcode.
Yes, it works from there
@sowens-csd you might want to mention higher up in the ReadMe that MacOS only works when being run from Xcode.
Addresses https://github.com/csdcorp/speech_to_text/issues/231
This pr adds macOS support with a HUGE caveat.
This functionality only works when running the app directly from Xcode. There is a known issue with flutter that the macOS app crashes when requesting permissions in VSCode https://github.com/flutter/flutter/issues/70374.
I leave this up to the author on if they want to merge this or not. But the functionality does exist.