Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/flutter_tts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 1.8.0

* Add `clearVoice`.
* Follow the analysis options of the frontend plugin.
* Apply clang-format-16 formatting.

Expand Down
3 changes: 2 additions & 1 deletion packages/flutter_tts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This package is not an _endorsed_ implementation of `flutter_tts`. Therefore, yo
```yaml
dependencies:
flutter_tts: ^4.2.5
flutter_tts_tizen: ^1.7.1
flutter_tts_tizen: ^1.8.0
```

Then you can import `flutter_tts` in your Dart code:
Expand All @@ -34,6 +34,7 @@ The features supported by Tizen are as follows. Other features are not supported
- [x] is language available
- [x] get voices
- [x] set voice
- [x] clear voice
- [x] set speech rate
- [x] set speech volume (requires privilege `http://tizen.org/privilege/volume.set` in `tizen_manifest.xml`)
- [x] get default voice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ void main() {
);
});

test('clearVoice returns 1', () async {
expect(await flutterTts.clearVoice(), 1);
});

test('setSpeechRate returns 1', () async {
expect(await flutterTts.setSpeechRate(0.5), 1);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tts/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_tts_tizen
description: The Tizen implementation of flutter_tts plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/main/packages/flutter_tts
version: 1.7.1
version: 1.8.0

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
7 changes: 7 additions & 0 deletions packages/flutter_tts/tizen/src/flutter_tts_tizen_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class FlutterTtsTizenPlugin : public flutter::Plugin {
OnGetDefaultVoice();
} else if (method_name == "setVoice") {
OnSetVoice(arguments);
} else if (method_name == "clearVoice") {
OnClearVoice();
} else if (method_name == "getVoices") {
OnGetVoices();
} else if (method_name == "getMaxSpeechInputLength") {
Expand Down Expand Up @@ -262,6 +264,11 @@ class FlutterTtsTizenPlugin : public flutter::Plugin {
SendResult(flutter::EncodableValue(0));
}

void OnClearVoice() {
tts_->ClearDefaultVoiceType();
SendResult(flutter::EncodableValue(1));
}

void OnGetVoices() {
flutter::EncodableList list;
for (auto voice : tts_->GetSupportedVoiceTypes()) {
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter_tts/tizen/src/text_to_speech.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class TextToSpeech {

void SetDefaultVoiceType(const std::string &voice);

void ClearDefaultVoiceType() { default_voice_type_ = TTS_VOICE_TYPE_AUTO; }

std::optional<int32_t> GetMaxSpeechInputLength();

std::optional<TtsState> GetState();
Expand Down
Loading