-
Notifications
You must be signed in to change notification settings - Fork 51
[flutter_tts] Refactor the C++ code #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
03c793e
to
d0c8edf
Compare
I'm not sure changing to exception throws is a good idea when the original code worked fine without them. If you are going to use exceptions, they must all be catched (it's easy to miss in callbacks) as @bbrto21 mentioned. nit: remove "[WIP]" in commit message. |
- Extract method. - Hiding tizen api in plugin.cc - Enhance error message handling (working) - Minimize use of output parameters - Change method name(Init-> TtsCreate, DeInit -> TtsDestroy, ...)
d0c8edf
to
efa2de7
Compare
@bbrto21 @HakkyuKim Thank you for review. I reverted the code related to the exception. |
efa2de7
to
7db8728
Compare
@swift-kim Any opinions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks. Otherwise looks good to me.
- int -> int32_t - remove debug log and [TTS] tag - rename callback functions - remove create and destroy function - etc
Calling [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Bad state: No element
#0 ListMixin.firstWhere (dart:collection/list.dart:167)
#1 FlutterTts.getSpeechRateValidRange (package:flutter_tts/flutter_tts.dart:320)
<asynchronous suspension>
#2 _MyAppState._speak (package:flutter_tts_tizen_example/main.dart:90)
<asynchronous suspension> Maybe we can
How do you think? The implementation can be done in a separate PR. |
Could you please explain more how to reproduce this log? |
@JSUYA You can add await FlutterTts.getSpeechRateValidRange; to anywhere in the example app (like |
…f tizen The value of "platform" is temporarily set to "android" instead of "tizen". Because it is not declared in TextToSpeechPlatform of TextToSpeech example.
Thank you for your advice. I updated PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Part of the code refactoring project.