Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Last active November 19, 2023 16:14
Show Gist options
  • Save sogaiu/89babbaa7b2a44db4ca549b5dca3b1a1 to your computer and use it in GitHub Desktop.
Save sogaiu/89babbaa7b2a44db4ca549b5dca3b1a1 to your computer and use it in GitHub Desktop.
praat on android via termux + vnc

praat on android (<= 11, > 12, >= 12L, 13)

ensure termux is installed and started

  • install from within f-droid -OR- via Download APK link on this page

  • start termux app

from within termux, build praat fetched via git (commit 5d42679c)

install some prerequisites

pkg upgrade
pkg install x11-repo
pkg install make clang binutils pkg-config gtk3 pulseaudio xorgproto
pkg install git

make symlink (usr/include/sys/soundcard.h -> usr/include/linux/soundcard.h)

cd /data/data/com.termux/files/usr/include/sys
ln -s ../linux/soundcard.h .
cd ~

fetch source

mkdir src && cd src
git clone https://github.com/praat/praat
cd praat

create makefile.defs containing following:

# File: makefile.defs.linux.termux

# System: Android via termux

CC ?= gcc
CXX ?= g++
LINK ?= g++

PKG_CONFIG ?= "pkg-config"

COMMONFLAGS = -D_FILE_OFFSET_BITS=64 -DUNIX -Dlinux -DHAVE_PULSEAUDIO `$(PKG_CONFIG) --cflags gtk+-3.0` \
	-Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O1 -g1 -pthread

CFLAGS = -std=gnu99 $(COMMONFLAGS) -Werror=missing-prototypes -Werror=implicit

CXXFLAGS = -std=c++17 $(COMMONFLAGS) -Wshadow

EXECUTABLE = praat

LIBS = `$(PKG_CONFIG) --libs gtk+-3.0` -lm -lpulse -lpthread

ICON =
MAIN_ICON =

build - likely will be waiting for a bit

make -j

check that praat was built

ls -al praat

prepare vnc server and window manager

install vnc server

pkg install tigervnc

start vnc server - may need to choose password here (remember for later)

vncserver -localhost

install a window manager

pkg install fluxbox

start window manager

export DISPLAY=":1"
fluxbox

use an android vnc client app to access window manager and start praat

  • ensure an android vnc client app (e.g. VNC Viewer from RealVNC) has been installed

  • start android vnc client app

  • create new connection with parameters: 127.0.0.1:5901 (N.B. 5901 = 5900 + 1, where 1 is from earlier $DISPLAY value)

  • start the new vnc connection (may need password from earlier) - should end up seeing the window manager launched earlier (e.g. fluxbox)

  • start aterm via right-click menu

  • start praat from inside aterm window

    cd ~/src/praat
    ./praat
    

references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment