FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssb22/gradint
  • st822/gradint
2 results
Show changes
Showing
with 99 additions and 12 deletions
#!/bin/bash
# Installing Gradint on GNU/Linux systems
# ---------------------------------------
# Gradint does not need to be installed, it can
# just run from the current directory.
# If you do want to make a system-wide installation
# (for example if you want to make a package for a
# GNU/Linux distribution), I suggest running as root
# the commands below.
# For a distribution you might also have to write
# man pages and tidy up the help text etc.
# Depends: python + a sound player (e.g. alsa-utils)
# Recommends: python-tk python-tksnack sox libsox-fmt-all madplay
# ---------------------------------------
set -e
PREFIX=/usr/local # or /usr
if which python >/dev/null 2>/dev/null; then PYTHON=python; else PYTHON=python3; fi
mkdir -p "$PREFIX/share/gradint"
mv gradint.py "$PREFIX/share/gradint/"
cd samples/utils
for F in *.py *.sh; do
DestFile="$PREFIX/bin/gradint-$(echo $F|sed -e 's/\..*//')"
mv "$F" "$DestFile"
chmod +x "$DestFile"
done
cd ../.. ; rm -rf samples/utils
tar -zcf "$PREFIX/share/gradint/new-user.tgz" \
advanced.txt settings.txt vocab.txt samples
cat > "$PREFIX/bin/gradint" <<'EOF'
#!/bin/bash
if ! [ -e "$HOME/gradint" ]; then
echo -n "Unpacking new user Gradint configuration... "
mkdir "$HOME/gradint"
cd "$HOME/gradint"
EOF
echo " tar -zxf \"$PREFIX/share/gradint/new-user.tgz\"" >> "$PREFIX/bin/gradint"
cat >> "$PREFIX/bin/gradint" <<'EOF'
echo "done."
fi
cd "$HOME/gradint"
EOF
echo "$PYTHON \"$PREFIX/share/gradint/gradint.py\" "'$@' >> "$PREFIX/bin/gradint"
chmod +x "$PREFIX/bin/gradint"
mkdir -p "$PREFIX/share/applications"
cat > "$PREFIX/share/applications/gradint.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=Gradint
Comment=Graduated-interval recall
Exec=$PREFIX/bin/gradint
Categories=Education;Languages
EOF
echo; echo "Installation complete."
echo "To uninstall: sudo rm -rf \"$PREFIX/bin/gradint\" \"$PREFIX/share/gradint\" \"$PREFIX/share/applications/gradint.desktop\" "
#!/bin/bash
# Do NOT modify this stub without changing the bs= count.
if test -d "$HOME/Desktop/Gradint.app"; then export A="Gradint 2.app"; else export A=Gradint.app; fi
dd if="$0" of="$HOME/Desktop/gradint.tbz" bs=393 skip=1 && cd "$HOME/Desktop" || exit 1
if [ -d "$HOME/Desktop/Gradint.app" ]; then A="Gradint 2.app"; else A=Gradint.app; fi
dd if="$0" of="$HOME/Desktop/gradint.tbz" bs=377 skip=1 && cd "$HOME/Desktop" || exit 1
echo "Please wait..."
open gradint.tbz
sleep 1
while ! test -e "$A/vocab.txt"; do sleep 1; done
while ! [ -e "$A/vocab.txt" ]; do sleep 1; done
echo "Opening $A..."
open "$A" ; exit
#!/bin/bash
export PATH="$PATH:/usr/local/bin" # in case lame etc is there
export PATH="/usr/local/bin:$PATH" # for python3 override + in case lame etc is there
cd "${BASH_SOURCE%/*}/../.." # needed on macOS 14, possibly 13
if sw_vers 2>/dev/null|grep ^ProductVersion.*1[2-9]; then # macOS 12+
if test $(python3 -c 'import tkinter,sys;print(sys.version_info[:3]>=(3,10,1))' 2>/dev/null) = "True"; then exec python3 gradint.py; fi
osascript -e "tell application (path to frontmost application as text) to display dialog \"macOS 12 bundled a broken version of the GUI libraries: please install Python 3 from python.org before running Gradint\" buttons {\"OK\"} with icon stop"
exec open http://www.python.org/download/mac/
fi
export VERSIONER_PYTHON_PREFER_32_BIT=1 # for Tk patch to work in 10.6
if test -e /usr/lib/libtk.dylib || test -e /usr/lib/tkConfig.sh || test -e /usr/local/lib/tkConfig.sh; then
export TK_SILENCE_DEPRECATION=1 # 11.4
if [ -e /usr/lib/libtk.dylib ] || [ -e /usr/lib/tkConfig.sh ] || [ -e /usr/local/lib/tkConfig.sh ] || [ -e /usr/bin/tkcon ]; then
# run using only the Tk windows:
cd "$(echo $0 | sed -e 's|start-gradint.app/Contents/MacOS/start-gradint.*$||')"
exec pythonw gradint.py
......
File moved
File moved
File added
......@@ -8,3 +8,6 @@ support dual architecture, so I wrote my own gcc commands to do it. There
were lots of warnings, especially about GSM. I wasn't worried about that
because Gradint doesn't use that functionality. But be careful about using
this SOX binary elsewhere, especially for GSM-related processing.
This version of sox does NOT run on OS X 10.8 (it complains about missing
libltdl.7.dylib). Use sox-14.4.2 instead for that.
File added
......@@ -9,17 +9,11 @@ languages (e.g. en=English, la=Latvian, zh=Zhongwen, etc)
and 'name' is any name you like but must be consistent
across abbreviations. The abbreviations must be the same as
the ones that are used in settings.txt (and advanced.txt).
(RISC OS users should replace '.' with '/'.)
If you don't already have a tool for recording and editing
sound files, try Audacity at http://audacity.sourceforge.net/
- look for its "export selection as WAV" function.
If you want to keep your recordings as MP3 files instead of
WAV files, you MUST read the section "IMPORTANT NOTES ABOUT MP3"
at the bottom of this document, to get it to work properly.
You still need to split them up into words or phrases.
Every word or phrase must have a first-language version and
a foreign-language version (but see later in this file if
you want to use foreign-language prompts or if you are
......@@ -129,13 +123,10 @@ file, and Gradint's code to do this is rather basic and gets
VBR files all wrong. I suggest encoding at CBR 48-kbit
(should be adequate for speech if the encoder is good).
If you're using Lame, try these parameters: --cbr -b 48 -h -m m
However, recent versions of Lame can code VBR in such a way
that the correct duration is read from the first frame.
Non-Windows users, please also read the notes below:
MAC OS: Mac OS gradint can play MP3s IN REAL TIME ONLY
without assistance, but if you want to output to a file then
you'll need to obtain madplay (as a command), or a version of
sox that has been compiled with MP3 support.
Non-Windows/Mac users, please also read the notes below:
LINUX / UNIX / CYGWIN : You need to obtain either madplay or
a version of sox that has been compiled with MP3 support.
......