foliate icon indicating copy to clipboard operation
foliate copied to clipboard

Foliate snap does not work with Festival

Open KristijanZic opened this issue 3 years ago • 1 comments

Foliate snap doesn't work with Festival. Even tho the festival is installed and Flatpak woks fine with it, snap doesn't. I can click the play tts button but it just get's pressed and unpressed as soon as I let go of the mouse click.

KristijanZic avatar Dec 05 '21 02:12 KristijanZic

The Snap package only supports espeak-ng and the mb-en1 voice at the moment. See #324.

johnfactotum avatar Dec 17 '21 17:12 johnfactotum

This should be fixed in the GTK 4 version now that it's using speech-dispatcher. It just needs to have permission to $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock. Also requires speech-dispatcher >= 0.11.4 installed on the host.

CC @soumyaDghosh

johnfactotum avatar Sep 28 '23 10:09 johnfactotum

@johnfactotum So, the speech-dispatcher needs to be added in the snap right?

soumyaDghosh avatar Sep 28 '23 10:09 soumyaDghosh

No, speech-dispatcher runs on the host. Foliate will use it by connecting to the socket at $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock. So it just needs readwrite access to the file.

johnfactotum avatar Sep 28 '23 11:09 johnfactotum

Note that currently it uses GLib.get_user_runtime_dir(), though: https://github.com/johnfactotum/foliate/blob/641a20c41dcb43e51cc2b83b55db92abd71867c4/src/speech.js#L21 And I'm not sure if it'd get the right path from that. It may need to be changed to something specific to Snap.

johnfactotum avatar Sep 28 '23 11:09 johnfactotum

Note that currently it uses GLib.get_user_runtime_dir(), though:

https://github.com/johnfactotum/foliate/blob/641a20c41dcb43e51cc2b83b55db92abd71867c4/src/speech.js#L21 And I'm not sure if it'd get the right path from that. It may need to be changed to something specific to Snap.

Can you explain me the way to test it?

soumyaDghosh avatar Sep 28 '23 11:09 soumyaDghosh

Install, on the host system, speech-dispatcher and espeak-ng, festival, etc. Open a book in Foliate. Click on the TTS button on the navbar, and press the play button in the popover. If it works it should connect to something like /run/user/1000/speech-dispatcher/speechd.sock and speech-dispatcher should produce speech. I'm not sure how the host XDG runtime directory is/can be exposed in Snap, but basically it just needs access to that .sock file on the host.

johnfactotum avatar Sep 28 '23 12:09 johnfactotum

Okay, I will give you the necessary changes, within a week. Will it be okay?

soumyaDghosh avatar Sep 28 '23 12:09 soumyaDghosh

Thanks! There's no hurry.

johnfactotum avatar Sep 28 '23 12:09 johnfactotum