Skip to content

Instantly share code, notes, and snippets.

@Ad5001
Last active December 19, 2017 18:10
Show Gist options
  • Save Ad5001/afdb56127fdd7adca9428803192c9534 to your computer and use it in GitHub Desktop.
Save Ad5001/afdb56127fdd7adca9428803192c9534 to your computer and use it in GitHub Desktop.
Adds TTS to ODT formats
#!/bin/sh
INSTALL="";
NEED_INSTALL=false;
if which pico2wave >/dev/null; then
echo "Found pico2wave..."
else
INSTALL="pico2wave"
NEED_INSTALL=true;
echo "Installing pico2wave..."
fi
if which vlc >/dev/null; then
echo "Found VLC..."
else
INSTALL="${INSTALL} vlc"
NEED_INSTALL=true;
echo "Installing VLC..."
fi
if which odt2txt >/dev/null; then
echo "Found odt2txt..."
else
cd /tmp
git clone https://github.com/dstosberg/odt2txt
cd odt2txt
pkexec make install
echo "Installing odt2txt..."
fi
if $NEED_INSTALL; then
pkexec apt install $INSTALL;
fi
pico2wave -l=${2:-"fr-FR"} -w=/tmp/out.wav "$(odt2txt $1)";
vlc /tmp/out.wav >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment