Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
- packages/tizen_package_manager/**/*
"p: tizen_rpc_port":
- packages/tizen_rpc_port/**/*
"p: tizen_stt":
- packages/tizen_stt/**/*
"p: tizen_window_manager":
- packages/tizen_window_manager/**/*
"p: url_launcher":
Expand Down
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ plugins:
geolocator: []
in_app_purchase: []
network_info_plus: []
tizen_stt: []
video_player_avplay: []
video_player_videohole: []

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_notification**](packages/tizen_notification) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_notification.svg)](https://pub.dev/packages/tizen_notification) | N/A |
| [**tizen_package_manager**](packages/tizen_package_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_package_manager.svg)](https://pub.dev/packages/tizen_package_manager) | N/A |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_rpc_port.svg)](https://pub.dev/packages/tizen_rpc_port) | N/A |
| [**tizen_stt**](packages/tizen_stt) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_stt.svg)](https://pub.dev/packages/tizen_stt) | N/A |
| [**tizen_window_manager**](packages/tizen_window_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_window_manager.svg)](https://pub.dev/packages/tizen_window_manager) | N/A |
| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://pub.dev/packages/url_launcher) (1st-party) | [![pub package](https://img.shields.io/pub/v/url_launcher_tizen.svg)](https://pub.dev/packages/url_launcher_tizen) | No |
| [**video_player_avplay**](packages/video_player_avplay) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay) | N/A |
Expand Down Expand Up @@ -85,6 +86,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_notification**](packages/tizen_notification) | ✔️ | ✔️ | ❌ | API not supported |
| [**tizen_package_manager**](packages/tizen_package_manager) | ✔️ | ✔️ | ✔️ |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | ✔️ | ✔️ | ✔️ |
| [**tizen_stt**](packages/tizen_stt) | ✔️ | ❌ | ❌ | Requires a supported microphone. |
| [**tizen_window_manager**](packages/tizen_window_manager) | ✔️ | ✔️ | ✔️ |
| [**url_launcher_tizen**](packages/url_launcher) | ✔️ | ❌ | ❌ | No browser app |
| [**video_player_avplay**](packages/video_player_avplay) | ✔️ | ❌ | ❌ | See README for details |
Expand Down
3 changes: 3 additions & 0 deletions packages/tizen_stt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial Tizen STT engine-recorder implementation.
25 changes: 25 additions & 0 deletions packages/tizen_stt/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2026 Samsung Electronics Co., Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of the
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 changes: 47 additions & 0 deletions packages/tizen_stt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# tizen_stt

Speech-to-text for Samsung TVs using the Tizen STT engine.

## Requirements

Requires a supported microphone.

Add the following to `tizen/tizen-manifest.xml`:

```xml
<privileges>
<privilege>http://tizen.org/privilege/recorder</privilege>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<feature name="http://tizen.org/feature/microphone"/>
<feature name="http://tizen.org/feature/speech.recognition"/>
```

## Usage

```dart
import 'package:tizen_stt/tizen_stt.dart';

final stt = TizenStt();
final subscription = stt.events.listen((event) {
if (event.isPartialResult || event.isFinalResult) print(event.text);
if (event.isError) print(event.errorName ?? event.message);
});

await stt.initialize();
await stt.startListening();
// After the user speaks:
await stt.stopListening();
// After receiving the result, when finished:
await stt.dispose();
await subscription.cancel();
```

Use `getLanguages()` to select a language and `cancel()` to discard recognition.
For hold-to-record controls, use `startListening(silenceDetection: false)` on
key-down and `stopListening()` on key-up, once the state is `recording`.
Unsupported silence-detection settings throw `PlatformException`; engine recording
time limits still apply. This controls the STT session, not remote microphone
activation or TV audio routing.
All instances share one session. Handle `PlatformException` from control calls.
See the [example](example) for a complete app.
26 changes: 26 additions & 0 deletions packages/tizen_stt/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# tizen_stt_example

[![pub package](https://img.shields.io/pub/v/tizen_stt.svg)](https://pub.dev/packages/tizen_stt)

Demonstrates how to use the tizen_stt plugin.

## Getting Started

To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).

1. Select **Initialize** and wait for `ready`.
2. Move focus to **Hold Select to record** using the directional buttons.
3. Hold the remote's **Select** button while speaking (keyboard Enter also works).
4. Release Select to stop recording and request the final STT result. The
recognized text appears below the controls.

Key repeats do not start additional recordings. Moving focus away stops the
recording; leaving the app releases the STT session. Silence detection is disabled
for each recording, so engines that do not support this setting report an error.
Engine recording time limits still apply.

The app uses the STT engine's microphone input. Select controls the STT session;
it does not activate a remote microphone or change TV audio routing. Verify that
your TV/engine provides microphone audio without pressing the remote's voice
button (which may launch Bixby). A supported, independently available microphone
is required. This cannot be verified with mocked widget tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:tizen_stt/tizen_stt.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final TizenStt stt = TizenStt();

setUp(() async {
expect(await stt.initialize(), TizenSttState.ready);
});

tearDown(() async {
await stt.dispose();
});

Future<void> expectTransition(
Future<TizenSttState> Function() action,
TizenSttState state,
) async {
final Future<void> event = stt.events
.timeout(const Duration(seconds: 10))
.firstWhere(
(TizenSttEvent event) => event.isError || event.state == state)
.then((TizenSttEvent event) =>
expect(event.state, state, reason: event.raw.toString()));
await Future.wait<Object?>(<Future<Object?>>[event, action()]);
}

test('languages and session disposal', () async {
expect(await stt.getLanguages(), isNotEmpty);
expect(await stt.getState(), TizenSttState.ready);
await stt.dispose();
expect(await stt.getState(), TizenSttState.notCreated);
});

test('recording can be cancelled', () async {
await expectTransition(stt.startListening, TizenSttState.recording);
await expectTransition(stt.cancel, TizenSttState.ready);
expect(await stt.getState(), TizenSttState.ready);
});

test('stopping recording starts processing', () async {
await expectTransition(stt.startListening, TizenSttState.recording);
await expectTransition(stt.stopListening, TizenSttState.processing);
});
}
Loading
Loading