flathub / org.sugarlabs.Words

https://flathub.org/apps/details/org.sugarlabs.Words
0 stars 2 forks source link

Just a question about Flatpak and espeak #2

Closed febrezo closed 4 years ago

febrezo commented 4 years ago

Hi! I am trying to build a simple application that simply provides speech-to-text and I feel that flatpak can help me a lot. I noticed that you are using it in your project but i am not able of running it in mine and I feel that it is something linked to how I build the espeak dependencies.

My testing code is simple with just a hello.sh file:

#!/bin/sh
echo "Hello world, from a sandbox"
espeak "Hello world from a sandbox!"

And my Flatpak looks like this, basically copying your dependencies from this repo and others that you run:

{
    "app-id": "com.felixbrezo.Speak",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "19.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "hello.sh",
    "finish-args" : [
        "--share=network",
        "--share=ipc",
        "--socket=fallback-x11",
        "--socket=wayland",
        "--filesystem=home",
        "--socket=pulseaudio"
    ],
    "modules": [
        {
            "name": "espeak-ng",
            "cleanup": [ "*.la" ],
            "no-parallel-make": true,
            "sources": [
                {
                    "type": "git",
                    "url": "https://github.com/espeak-ng/espeak-ng.git",
                    "tag": "1.49.2",
                    "commit": "3ed34d3a74eb69cedcdfa98dbedef4359279d352"
                }
            ],
            "post-install": [
                "ln -s /app/lib/libespeak-ng.so /app/lib/libespeak.so",
                "ln -s /app/lib/libespeak-ng.a /app/lib/libespeak.a"
            ]
        },
        {
            "name": "hello",
            "buildsystem": "simple",
            "build-commands": [
                "install -D hello.sh /app/bin/hello.sh"
            ],
            "sources": [
                {
                    "type": "file",
                    "path": "hello.sh"
                }
            ]
        }
    ]
}

PD: Sorry for putting the question here, but I feel that this is one of the few repositories that are dealing with espeak with Flatpak.

tchx84 commented 4 years ago

Hey @febrezo ,

Not sure why that would be TBH, but if you want to run espeak exactly like in these apps you should be using the GStreamer plugin.

Here's an example https://github.com/sugarlabs/speak/blob/master/speech.py#L35

If you still want to explore other build options for espeak-ng, I recommend to:

  1. try a newer espeak-ng version.
  2. try different configure options, or
  3. check the fedora/debian packages to see if they do something differently.