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

Android Obsidian 1.4.0, the language specific voices of Text to Speech can not select voice #21

Open
ajmz opened this issue Oct 16, 2022 · 6 comments
Labels
wontfix This will not be worked on

Comments

@ajmz
Copy link

ajmz commented Oct 16, 2022

Android Obsidian 1.4.0, the language specific voices of Text to Speech can not select voice, while the Obsidian 1.0 for windows works well.

@joethei joethei added the wontfix This will not be worked on label Oct 16, 2022
@joethei
Copy link
Owner

joethei commented Oct 16, 2022

This plugin does not work at all on Android.
See the README and #8

@ajmz
Copy link
Author

ajmz commented Oct 16, 2022

This plugin does not work at all on Android. See the README and #8

Thanks a lot. I will report it to the development team of Obsidian to see if it can support TTS for Android environment.

@joethei
Copy link
Owner

joethei commented Oct 16, 2022

No, we can't
(I am also part of that team)
The issue is with Android itself, see the link the README.

@ajmz
Copy link
Author

ajmz commented Oct 17, 2022

Thanks for replying, I'm not a programmer.
But I read the README and the link inside to https://bugs.chromium.org/p/chromium/issues/detail?id=487255 .

I found the comment as follows, "But the problem I had was solvable":

Comment 62 by [email protected] on Mon, Jun 21, 2021, 6:54 AM GMT+8
I might have misunderstood the purpose of this issue. But the problem I had was solvable.

I was using utterance.voice which is only wrong on Android Chrome. The following snippet is broken.

let utterance = new SpeechSynthesisUtterance("hello");
let voice = speechSynthesis.getVoices()[0]
utterance.voice = voice;
speechSynthesis.speak(utterance);

That works on Chrome Windows, iOS, MacOS, Firefox Android, but doesn't work on Android Chrome. The following works on all platforms I tested. To test in the console, you might have to run it twice to make sure the voices are loaded:

let utterance = new SpeechSynthesisUtterance("hello");
let voice = speechSynthesis.getVoices()[0]
utterance.voice = voice; // required for iOS
utterance.lang = voice.lang; // required for Android Chrome
utterance.voiceURI = voice.voiceURI; // unclear if needed
speechSynthesis.speak(utterance);

And you should hear a non-native accent saying "hello".

@usernotnull
Copy link

let utterance = new SpeechSynthesisUtterance("hello");
let voice = speechSynthesis.getVoices()[0]
utterance.voice = voice; // required for iOS
utterance.lang = voice.lang; // required for Android Chrome
utterance.voiceURI = voice.voiceURI; // unclear if needed
speechSynthesis.speak(utterance);

And you should hear a non-native accent saying "hello".

BTW, I tried the quoted workaround, but it didn't resolve the issue.
It's a shame, it would really benefit me to listen to my vault while on the go 😞

@ctkenyon
Copy link

Rather than waiting on Google to fix webview on Android (9+ years & counting) would it make sense to consider an alternate approach whereby the note could be shared with other apps capable of rendering markdown with built-in TTS facilities such as MS-EDGE?

If That approach would be considered out of scope for this plug-in, are there others that I overlooked capable of doing that or worth requesting a plug-in specifically to share notes with other apps with specific features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants