Skip to content

RDKDEV-1789: Add TTS Engine Documentation - #16

Open
gourivarma3 wants to merge 1 commit into
rdkcentral:developfrom
gourivarma3:feature/RDKDEV-1789
Open

gourivarma3 wants to merge 1 commit into
rdkcentral:developfrom
gourivarma3:feature/RDKDEV-1789

Conversation

@gourivarma3

Copy link
Copy Markdown

RDKDEV-1789
Reason for Change: To add Component Documentation for ttsengine.
Fix: Added the README documentation
Test Procedure: None

I have read the CLA Document and I hereby sign the CLA
Signed-off-by: gourivarma3 gouri_varma@comcast.com

@gourivarma3
gourivarma3 requested a review from a team as a code owner October 8, 2026 10:50
Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:50
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Incorrect backend capability and authentication guarantees could mislead application integration.

8 open findings
What changed in this PR

Adds component documentation for the TTS Engine client library within the RDK middleware stack.

Changes:

  • Describes architecture, IPC backends, and lifecycle flows with diagrams.
  • Documents APIs, callbacks, dependencies, and configuration.
File Description
docs/​README.md Adds TTS Engine architecture and integration documentation.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread docs/README.md
**Key Features & Responsibilities:**

- **Multi-backend IPC abstraction**: Supports three communication backends — JSON-RPC (default), COM-RPC, and Firebolt — selectable at build time or runtime via environment variable, with a common API surface exposed to callers in all cases.
- **Speech session lifecycle management**: Provides APIs to create and destroy per-application speech sessions, and to track session state (active, idle).
Comment thread docs/README.md
- **Speech session lifecycle management**: Provides APIs to create and destroy per-application speech sessions, and to track session state (active, idle).
- **Full speech control**: Exposes APIs to initiate speech synthesis (`speak`), pause, resume, and abort ongoing or pending speech requests.
- **TTS configuration management**: Allows reading and writing TTS parameters including endpoint URL, language, voice, volume, and speech rate.
- **Event-driven callback model**: Delivers asynchronous notifications to callers for all speech lifecycle events (start, pause, resume, cancel, interrupt, complete) and error conditions (network error, playback error), as well as TTS enable/disable state and voice change notifications.
Comment thread docs/README.md
- **Full speech control**: Exposes APIs to initiate speech synthesis (`speak`), pause, resume, and abort ongoing or pending speech requests.
- **TTS configuration management**: Allows reading and writing TTS parameters including endpoint URL, language, voice, volume, and speech rate.
- **Event-driven callback model**: Delivers asynchronous notifications to callers for all speech lifecycle events (start, pause, resume, cancel, interrupt, complete) and error conditions (network error, playback error), as well as TTS enable/disable state and voice change notifications.
- **Security token integration**: Acquires and uses WPEFramework security tokens automatically when communicating with the Thunder plugin, with fallback to unsecured operation when the security utility is absent.
Comment thread docs/README.md

## Design

The TTS Engine client library is structured around a Bridge pattern that cleanly separates the public API from the underlying IPC mechanism. The `TTSClient` class is the sole entry point for callers; it owns a pointer to a `TTSClientPrivateInterface` instance selected at creation time based on the configured or detected backend. This design means the calling application is fully insulated from IPC transport details and requires no change when the backend is switched.
Comment thread docs/README.md

#### Platform and Integration Requirements

- **Build Dependencies**: `wpeframework`, `wpeframework-clientlibraries`, `gstreamer1.0-plugins-base`, `rdk-logger`, `breakpad` (when `ENABLE_BREAKPAD=1`), `FireboltSDK` (when Firebolt backend is selected).
Comment thread docs/README.md

- When the `org.rdk.TextToSpeech` plugin fires `onttsstatechanged`, the service layer dispatches `onTTSStateChanged(bool)` to all registered `TTSConnectionCallback` instances.
- When the voice is changed on the plugin side, `onVoiceChanged(string)` is delivered.
- If the Thunder plugin deactivates (detected via the WPEFramework plugin state-change handler), registered clients receive `onTTSServerClosed()`.
Comment thread docs/README.md
Comment on lines +351 to +357
| `Exchange::ITextToSpeech::enableTTS()` | COM-RPC | Enable or disable TTS globally | `TTSClientPrivateCOMRPC.cpp` |
| `Exchange::ITextToSpeech::setConfiguration()` | COM-RPC | Set TTS configuration | `TTSClientPrivateCOMRPC.cpp` |
| `Exchange::ITextToSpeech::getConfiguration()` | COM-RPC | Get TTS configuration | `TTSClientPrivateCOMRPC.cpp` |
| `Exchange::ITextToSpeech::speak()` | COM-RPC | Submit text for synthesis | `TTSClientPrivateCOMRPC.cpp` |
| `Exchange::ITextToSpeech::cancel()` | COM-RPC | Abort ongoing speech | `TextToSpeechServiceCOMRPC.cpp` |
| `Exchange::ITextToSpeech::pause()` | COM-RPC | Pause ongoing speech | `TextToSpeechServiceCOMRPC.cpp` |
| `Exchange::ITextToSpeech::resume()` | COM-RPC | Resume paused speech | `TextToSpeechServiceCOMRPC.cpp` |
Comment thread docs/README.md

| Parameter | Type | Default | Description |
| ------------------------ | ---------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TTS_CLIENT_BACKEND` | env string | (build default) | Selects the active IPC backend at runtime. Accepted values: `comrpc`, `firebolt`. When absent or set to an unrecognized value, the JSON-RPC backend is used. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants