Skip to content
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

New feature added: Integrated WebView with Native Speech and PiperTTS #3695

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alpgul
Copy link

@alpgul alpgul commented Jan 12, 2025

Description

Checklist

  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Config

You can get the voice list from this link.

...
"readResponseTTS": {"type":"native","lang":"en-US"}
...
"readResponseTTS": {"type":"piperTTS","lang":"en-US"}
...
"readResponseTTS": {"type":"piperTTS","lang":"en_US-arctic-medium"}

Fixed

Resolved issue with stopping audio playback #2311

Issue

Usage of worker within WebView only accepts blob URLs. As a temporary solution, a worker has been defined. Vite can't detect the web worker with blobURL, and this issue needs to be resolved.

Copy link

netlify bot commented Jan 12, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 8c92612
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/6784ad07ce6fc800086eadd7

Choose a reason for hiding this comment

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

The useWebviewListener("setTTSNative") handler's mixed return types (true, false, or a Promise) can cause inconsistent behavior, making it harder to handle. Standardizing the return type to always be a Promise or whatever is ideal ensures predictability and simplifies integration, reducing potential bugs and improving maintainability.

The Promise in setTTSNative lacks explicit error handling, which could result in uncaught errors during unexpected failures. Try wrapping the logic in a try-catch block to ensure errors are logged and handled.

Copy link
Author

Choose a reason for hiding this comment

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

The useWebviewListener("setTTSNative") handler's mixed return types (true, false, or a Promise) can cause inconsistent behavior, making it harder to handle. Standardizing the return type to always be a Promise or whatever is ideal ensures predictability and simplifies integration, reducing potential bugs and improving maintainability.

The Promise in setTTSNative lacks explicit error handling, which could result in uncaught errors during unexpected failures. Try wrapping the logic in a try-catch block to ensure errors are logged and handled.

setTTSNative:[{lang:string, message:string}, boolean];
In the code above, the return value is defined only as boolean, and there isn't Promise return type.

Since only the event is defined within the Promise, any error will only affect the event and will not impact the Promise

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.

2 participants