From ea41f5b9998b3311202c52b7ce44f72cc538cbc1 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 30 Jul 2007 19:29:58 +0000 Subject: Small example is added - Cache generator for multi-language tests --- examples/rusxmms_cache.pl | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 examples/rusxmms_cache.pl (limited to 'examples') diff --git a/examples/rusxmms_cache.pl b/examples/rusxmms_cache.pl new file mode 100755 index 0000000..ea251fd --- /dev/null +++ b/examples/rusxmms_cache.pl @@ -0,0 +1,54 @@ +#! /bin/bash + +if [ -z "$1" ]; then + echo "Please, specify directory with mp3 files (the list.txt should contain language information)" + echo + exit +fi + +list=$1/list.txt +if [ ! -f $list ]; then + echo "The list.txt with language information is missing in specified directory" + echo + exit +fi + +rccconf=~/.rcc/xmms.xml +if [ ! -f $rccconf ]; then + tagreader + if [ ! -f $rccconf ]; then + echo "Can't locate RCC configuration" + echo + exit + fi +fi + + +echo "Setting timeout to 5s" +perl -pi -e 's|||' $rccconf + +echo "Setting leraning mode to LELEARN" +perl -pi -e 's|||' $rccconf + +for filename in $1/*.mp3; do + name=`basename "$filename"` + lang=`grep "$name" $list | cut -d ' ' -f 1` + + echo "MP3: $name, Language: $lang" + perl -pi -e "s|.*|$lang|" $rccconf + + echo " Recoding..." + perl -pi -e 's|||' $rccconf + tagreader $filename &> /dev/null + + echo " Translating to English..." + perl -pi -e 's|||' $rccconf + tagreader filename &> /dev/null + + echo " Translating..." + perl -pi -e 's|||' $rccconf + tagreader filename &> /dev/null +done + +echo "Setting leraning mode to ON" +perl -pi -e 's|||' $rccconf -- cgit v1.2.3