tobyatgithub / ReadalongsDesktop

A desktop GUI app for readalongs to help indigenous communities teach and pass on their languages.
MIT License
3 stars 2 forks source link
mit-license python qtpy

ReadalongsDesktop

python badge gui license badge

This library is a desktop app with GUI for the readalongs studio project.
Readalongs is an audiobook alignment tool for indigenous language.

Table of Contents

Background

A desktop version of readalongs is developed in order to overcome these three main challenges:

  1. Direct users may not be familiar with Linux/Unix, Python, and Docker technologies (e.g. we shall not require users to understand how to use terminal to use this app.)
  2. Users may have limited access to the internet.
  3. Communities would prefer to perform tasks offline. (data privacy)

As a result, this desktop version of readalong will allow users to perform tasks by clicks, and support all functionalities without needing the internet.

Install

0. (Optional) Create a conda env, notice that python version has to be >= 3.7

# create
conda create --name readalongsDesktop python=3.7

# activate
source activate readalongsDesktop

On Windows, install ffmpeg and qt using conda:

conda install ffmpeg
conda install qt

On other systems, install ffmpeg and qt using your standard package manager.

1. Git clone and install packages

git clone https://github.com/tobyatgithub/ReadalongsDesktop.git
cd ReadalongsDesktop
pip install -r requirements.txt

2. Pick a Qt bindings library to install:

For licensing reason, the user will need to pick their own Qt bindings library to install in the same python environment, the common options are pyqt4, pyqt5, pyside2, and pyside6.

For example, you can install pyqt5 with:

pip install PyQt5

or

conda install pyqt5

At this point, you shall be able to run the GUI app on your local machine with:

python desktopapp.py

(To test:) user may need to install g2p, Studio, and SoundSwallower in the same root directory to make it work.

3. Package this app with pyinstaller to distribute

In the ReadalongsDesktop folder, install the pyinstaller and run the following command (depends on windows/mac)

pip install pyinstaller

Notice we will need to use different command on windows vs. mac. On windows (to test):

pyinstaller desktopApp.py --add-binary ../g2p/g2p/mappings/langs/langs.pkl:g2p/mappings/langs --add-binary ../g2p/g2p/mappings/langs/network.pkl:g2p/mappings/langs --add-binary ../SoundSwallower:SoundSwallower

On mac (tested on intel chip):

pyinstaller desktopApp.py --add-data ../g2p/g2p/mappings/langs/langs.pkl:g2p/mappings/langs --add-data ../g2p/g2p/mappings/langs/network.pkl:g2p/mappings/langs --add-data ../SoundSwallower:SoundSwallower

Then, go to -> dist -> desktopApp. You shall find an executable file named as desktopApp

Double click on the desktopApp executable (wait for a little while) and you shall see the GUI.

PS: For mac m1 users, you may need to install upx first

https://macappstore.org/upx/

arch -arm64 brew install --build-from-source upx

Usage

In this repo, we also included a small example to run:

  1. Start the Desktop app via terminal
python desktopApp.py
  1. Run with provided testing file:
  1. Exit (need fix) by hit control-C in terminal

License