Closed Nitrousoxide closed 9 months ago
It should work if speech-dispatcher is actively running on the host, but it does appear that it can't activate speech-dispatcher automatically if it isn't running.
Are there any good human like tts voices who can do tts with foliate?
Just found out https://github.com/rhasspy/piper
The voice samples, they are too good https://rhasspy.github.io/piper-samples/
if we could get it working as a flatpak, that'd be nice.
I've installed rpm-ostree install speech-dispatcher-utils
and spd-say Hello!
does output "hello" audio on fedora 39 silverblue.
but with flatpak foliate even with talkname and full system access, it is throwing error:
here's the error output:
rizvan@fedora:~$ flatpak run --talk-name=org.freedesktop.Flatpak --filesystem=host com.github.johnfactotum.Foliate
(com.github.johnfactotum.Foliate:2): com.github.johnfactotum.Foliate-CRITICAL **: 02:01:41.528: Error: Error connecting to /run/user/1000/speech-dispatcher/speechd.sock: Gio.IOErrorEnum: Could not connect: Connection refused
connect@resource:///com/github/johnfactotum/Foliate/speech.js:28:19
init@resource:///com/github/johnfactotum/Foliate/speech.js:83:30
send@resource:///com/github/johnfactotum/Foliate/speech.js:114:20
stop@resource:///com/github/johnfactotum/Foliate/speech.js:146:21
#init@resource:///com/github/johnfactotum/Foliate/tts.js:64:21
speak@resource:///com/github/johnfactotum/Foliate/tts.js:79:19
#onSelection@resource:///com/github/johnfactotum/Foliate/book-viewer.js:879:34
selection@resource:///com/github/johnfactotum/Foliate/book-viewer.js:461:53
@resource:///com/github/johnfactotum/Foliate/book-viewer.js:215:23
registerHandler/<@resource:///com/github/johnfactotum/Foliate/webview.js:172:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
^C
I've installed
rpm-ostree install speech-dispatcher-utils
andspd-say Hello!
does output "hello" audio on fedora 39 silverblue.but with flatpak foliate even with talkname and full system access, it is throwing error:
Just to test this some more.
I gave spd-say a long bit of text to speak out and while it was still speaking started foliate's TTS.
spd-say Hello, this is a test to see how well things are working. Id like to see how long they will continue to talk
It did successfully speak. I've not added/removed any permissions for foliate's flatpak. I would note there are no controls for TTS though, so once you start it you can't stop it unless you back out of the book entirely.
I assume it is trying to tap into the speechd.sock which only temporarily exists while an ongoing speech command is running.
If you try to start tts in foliate without first starting spd-say in a terminal with some text line you get this (on fedora 39 workstation)
❯ flatpak run com.github.johnfactotum.Foliate
(com.github.johnfactotum.Foliate:2): com.github.johnfactotum.Foliate-WARNING **: 17:28:46.322: Gio.IOErrorEnum: Access to service is disallowed 'SERVICE'
getURIFromTracker@resource:///com/github/johnfactotum/Foliate/library.js:30:30
get@resource:///com/github/johnfactotum/Foliate/library.js:56:42
getBookFromIdentifier@resource:///com/github/johnfactotum/Foliate/library.js:105:36
getBook@resource:///com/github/johnfactotum/Foliate/library.js:101:21
activate@resource:///com/github/johnfactotum/Foliate/library.js:394:63
activate@resource:///com/github/johnfactotum/Foliate/library.js:322:18
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
I gave spd-say a long bit of text to speak out
You can use spd-say -e
to keep the server running without speaking.
I assume it is trying to tap into the speechd.sock which only temporarily exists while an ongoing speech command is running.
In older versions of speech-dispatcher, yes. But it supports socket activation starting from 0.11.4.
The Ubuntu package for speech-dispatcher installs a /usr/lib/systemd/user/speech-dispatcher.socket
(see https://packages.ubuntu.com/mantic/amd64/speech-dispatcher/filelist). I just tried the Snap version on Ubuntu (which has strict confinement, so as with Flatpak it can't directly spawn speech-dispatcher), and TTS works.
But the packages for Debian (https://packages.debian.org/bookworm/amd64/speech-dispatcher/filelist) and Arch Linux (https://archlinux.org/packages/extra/x86_64/speech-dispatcher/files/) don't install this file. Presumably this is the case on Fedora as well.
If you try to start tts in foliate without first starting spd-say in a terminal with some text line you get this
No, that warning is about Tracker. I think it happens if you don't have tracker-miners
installed. SERVICE
here refers to dbus:org.freedesktop.Tracker3.Miner.Files
.
Just tried the Flatpak on Ubuntu, and it seems to be working.
Added a section in troubleshooting with an explanation and a workaround for this issue: https://github.com/johnfactotum/foliate/blob/gtk4/docs/troubleshooting.md#text-to-speech-doesnt-work
Thank you, starting speech-dispatcher --timeout 0
in a terminal then asking foliate to play works.
I'm really thankful for such a wonderful ebook reader, and you've really done a great job with foliate.
Do you by any chance know how to change the speech-dispatcher to use "piper" voices which are really good. the robotic voice is not so cool you know.
Do you by any chance know how to change the speech-dispatcher to use "piper" voices which are really good.
Thank you, starting
speech-dispatcher --timeout 0
in a terminal then asking foliate to play works.I'm really thankful for such a wonderful ebook reader, and you've really done a great job with foliate.
Do you by any chance know how to change the speech-dispatcher to use "piper" voices which are really good. the robotic voice is not so cool you know.
Posting this here as well
@qoijjj thank you so much, I've installed voices using pied. they work.
in a terminal speech-dispatcher --timeout 0
start foliate and select text and choose 'Speak from Here'
@johnfactotum could you integrate or suggest users to use pied to get great voices.
Describe the bug TTS does not work in the flatpak.
To Reproduce Steps to reproduce the behavior:
Expected behavior TTS should start.
Screenshots![image](https://github.com/johnfactotum/foliate/assets/1363931/3c398804-5e0c-4437-84fc-56b357b8259b)
Version:
Additional context I have speech dispatcher installed (via a distrobox container and exported to ~/.local/bin) on this host but the flatpak container does not pick it up. Though the flatpak should probably have that dependency installed in its own container if it's an actual dep.