Closed marwan-at-work closed 3 months ago
Good suggestion, thank you.
Just noticed myself that dictation on macOS 14 (Sonoma) has become really excellent (everyone has their eyes on Whisper and friends) and also recognizes questions on the spot. However, very unfortunately not the package here. Would love to see the same punctation as macOS does! 🙏🏼
Hi there,
Thank you for this very helpful package!
The iOS implementation has the following option which I don't see in Dart: https://developer.apple.com/documentation/speech/sfspeechrecognitionrequest/3930023-addspunctuation?changes=_9
Would it be possible to add this option to the Dart side? I'm not familiar enough with either languages but happy to help however I can.
Thanks
you can add this feature at SwiftSpeechToTextPlugin.swift. add the code in listenForSpeech function:
if #available(iOS 16, *) { currentRequest.addsPunctuation = true }
I understand that the idea is to have the library as unified as possible, but it would be awesome to have a flag that enables punctuation for iOS devices without having to fork the library and add it separately 🙏
There is a new version in pub.dev now, 6.6.0-dev which supports an option to enable automatic punctuation on iOS during recognition. I've changed the listen method to optionally use a listenOptions parameter instead of other individual parameters for the options. It is a SpeechListenOptions type which has autoPunctuation as an available option. So it would look like this:
final options = SpeechListenOptions(
onDevice: _onDevice,
listenMode: ListenMode.confirmation,
cancelOnError: true,
partialResults: true,
autoPunctuation: true,
enableHapticFeedback: true);
speech.listen(
onResult: resultListener,
listenFor: Duration(seconds: listenFor ?? 30),
pauseFor: Duration(seconds: pauseFor ?? 3),
localeId: _currentLocaleId,
onSoundLevelChange: soundLevelListener,
listenOptions: options,
);
Please let me know if you have a chance to try it.
@sowens-csd thank you very much 🙏 I was about to fork the repo this/next week so I'm super stoked that you took your time to add it to your library
btw. I'd love to buy you a virtual coffee if you have a website set up for it
I might be biased but it feels like the recent update made the initialization process much slower @sowens-csd
I'm using 6.6.0-dev
Interesting, it shouldn't have changed at all. I can't think of anything recent that would have affected the initialization. What kind of time difference are you seeing?
If there is no clear change on your side that should affect this then let me measure it on both versions and report back to you , maybe it's a mistake on my side @sowens-csd
Ok, works ok now. Sorry, false alarm.
Thanks for verifying and for letting me know.
Hi there,
Thank you for this very helpful package!
The iOS implementation has the following option which I don't see in Dart: https://developer.apple.com/documentation/speech/sfspeechrecognitionrequest/3930023-addspunctuation?changes=_9
Would it be possible to add this option to the Dart side? I'm not familiar enough with either languages but happy to help however I can.
Thanks