All pastes #909577 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-19 08:30 UTC
rendered paste body
#!/bin/bash
set -e
[[ "$1" == *.talk ]] && exit 0 # no .talk.talk
[ "$1" = . -o "$1" = .. ] && exit 0
if [ -f "$1" ]; then
  OUTNAME="${1}.talk"
elif [ -d "$1" ]; then
  OUTNAME="${1}/_dirname.talk"
else
  echo "Usage $0 <file_or_dir>"
  exit 1
fi
[ -f "$OUTNAME" ] && exit 0 # don't recreate if .talk clip already exists

tmpf=~/tmp/x-$$.wav

SAY=$(basename "$1")

espeak -s 240 -w "$tmpf" "$SAY"
/path/to/rbspeexenc -q 8 -c 10 -v 0.6 "$tmpf" "${OUTNAME}"
rm "$tmpf"