Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: voicebox.ksh

voicebox.ksh

From: Terry Klarich <terry_at_klarich.net>
Date: 2006-06-13

I didn't include the script. Here is my second try.

Hello all:
Here is a ksh script which will build those _dirname.talk and [filename].talk files we have all come to love. It Uses lame and
festival.

Please let me know if you use it. I will accept bug reports and modification requests.

It seems to work fine on my linux machine on my iaudio x5l.

Terry

----------CUT HERE----------
##!/bin/ksh
##voicebox.ksh
##version 1.0 06/13/2006
##Terry Klarich
##Use at your own risk
##There is no copyright. I would ask that you just leave my name in for any future modifications
##This script will create the _dirname.talk and [filename].talk files used to make rockbox speak the directories and filenames on
##your juke box.
##You will need lame and festival
##usage: voicebox.ksh <directory>

echo "looking for the lame command"
which lame
if [ $? -ne 0 ] ; then
 echo "Couldn't find the lame command: terminating"
 exit 1
fi
echo "looking for the text2wave command"
which text2wave
if [ $? -ne 0 ] ; then
 echo "Couldn't find the text2wave command: Please install festival: terminating"
 exit 1
fi
if [ -z "$1" ] ; then
 echo "usage: voicebox.ksh <dirname>"
 echo "<dirname> is the root directory of your media files."
 echo "example: voicebox.ksh /mnt/mp3"
 exit 1
fi
if [ ! -d "$1" ] ; then
 echo "$1 doesn't exist"
 exit 1
fi
echo "building voice clips for all directories."
find $1 -type d -print |
while read i ; do
 if [ ! -f "$i/_dirname.talk" ] ; then
  name=`echo $i | sed 's:^.*/::'`
  echo $name
  echo $name | text2wave -otype aiff -o /tmp/output -
  lame --quiet --preset voice /tmp/output $i/_dirname.talk
  rm /tmp/output
 fi
done
echo "building voice clips for files."
find $1 -type f \( -name '*.mp3' -o -name '*.wav' \) -print |
while read i ; do
 j="$i.talk"
 if [ ! -f "$j" ] ; then
  name=`echo $i | sed 's:^.*/::'`
  echo $name
  echo $name | text2wave -otype aiff -o /tmp/output -
  lame --quiet --preset voice /tmp/output "$j"
  rm /tmp/output
 fi
done
Received on Tue Jun 13 22:43:48 2006


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa