Archive for the ‘Uncategorized’ Category

Geany regex regular expression

Sunday, July 24th, 2011

Geany regex regular expression
\t\w+$

tab alphanumeric character repeat end of line

friedrich

Friday, February 18th, 2011

How I create friedrich

saxonb-xslt -ext:on -s:’/home/ubuntu/Documents/2011-i/german-0.2.5/german-dictionary-0.2.4.xml’ \
-xsl:’/home/ubuntu/Documents/2011-i/combine-0.2.4/lexicon2prompts.xsl‘ \
-o:’/home/ubuntu/Documents/dummy.xml’

latin xaf

Tuesday, February 15th, 2011

mkdir /media/104d991d-2062-40d7-89f6-ddde3cb5b781/home/ubuntu/Documents/2011-i/latin-0.1.3/split/xaf-folder/latin-ipa-flac-files-xaf-20110214/wav-xaf

cd /media/104d991d-2062-40d7-89f6-ddde3cb5b781/home/ubuntu/Documents/2011-i/latin-0.1.3/split/xaf-folder/latin-ipa-flac-files-xaf-20110214/flac-xaf && for f in *.flac; do sox “$f” /media/104d991d-2062-40d7-89f6-ddde3cb5b781/home/ubuntu/Documents/2011-i/latin-0.1.3/split/xaf-folder/latin-ipa-flac-files-xaf-20110214/wav-xaf/${f%.flac}.wav; done

prompts folder: /media/104d991d-2062-40d7-89f6-ddde3cb5b781/home/ubuntu/Documents/2011-i/latin-0.1.3/split/xaf-folder/latin-ipa-flac-files-xaf-20110214/prompts-xaf

base directory: /media/104d991d-2062-40d7-89f6-ddde3cb5b781/home/ubuntu/Documents/2011-i/latin-0.1.3/split/xaf-folder/latin-ipa-flac-files-xaf-20110214/wav-xaf

preparing latin speech model xaf:
file:///tmp/kde-ubuntu/simond/default/compile/hmm24/hmmdefs
file:///tmp/kde-ubuntu/simond/default/compile/hmm24/macros
file:///tmp/kde-ubuntu/simond/default/compile/tiedlist
file:///tmp/kde-ubuntu/simond/default/compile/stats

mkdir wav-all combine-audio-files.xsl

Saturday, September 25th, 2010

ls /home/ubuntu/Documents/201009/combine-0.2.1/wav-all > /home/ubuntu/Documents/201009/combine-0.2.1/dir-wav-all

cd /home/ubuntu/Documents/201009/combine-0.2.1/alpha && for f in *.flac; do sox "$f" /home/ubuntu/Documents/201009/combine-0.2.1/wav-all/${f%.flac}.wav; done && cd /home/ubuntu/Documents/201009/combine-0.2.1/bravo && for f in *.flac; do sox "$f" /home/ubuntu/Documents/201009/combine-0.2.1/wav-all/${f%.flac}.wav; done && cd /home/ubuntu/Documents/201009/combine-0.2.1/charlie && for f in *.flac; do sox "$f" /home/ubuntu/Documents/201009/combine-0.2.1/wav-all/${f%.flac}.wav; done && cd /home/ubuntu/Documents/201009/combine-0.2.1/diego && for f in *.flac; do sox "$f" /home/ubuntu/Documents/201009/combine-0.2.1/wav-all/${f%.flac}.wav; done && cd /home/ubuntu/Documents/201009/combine-0.2.1/echo && for f in *.flac; do sox "$f" /home/ubuntu/Documents/201009/combine-0.2.1/wav-all/${f%.flac}.wav; done

mkdir /home/ubuntu/Documents/201009/combine-0.2.1/wav-all

saxonb-xslt -ext:on -s:'/home/ubuntu/Documents/201009/combine-0.2.1/lexicon-alpha.xml' -xsl:'/home/ubuntu/Documents/201009/combine-0.2.1/combine-audio-files.xsl'

while read line

Saturday, September 18th, 2010

ubuntu@ubuntu-desktop:~$ while read line; do cp "$line" /home/ubuntu/Documents/201009/combine-0.2.1/alpha-reduced; done < /home/ubuntu/Documents/201009/combine-0.2.1/cp-alpha-unique

read
--
ubuntu@ubuntu-desktop:~$ paste /home/ubuntu/Documents/201008/split-0.2.1/xaat-folder/labels.txt /home/ubuntu/Documents/201008/split-0.2.1/xaat > /home/ubuntu/Documents/201008/split-0.2.1/xaat-folder/labels-pasted.txt
--
ubuntu@ubuntu-desktop:~$ cat '/home/ubuntu/Documents/201008/german-0.2.1/german-0.2.1.xml' | saxonb-xslt -ext:on -s:- -xsl:'/home/ubuntu/Documents/201008/german-0.2.1/improve-german.xsl' -o:'/home/ubuntu/Documents/201008/german-0.2.1/object/german-0.2.2.xml'

Latin 0.1.2 prepare phoneme list

Sunday, August 29th, 2010

ubuntu@ubuntu-desktop:~$ cat ‘/home/ubuntu/Documents/201008/latin-0.1.2/latin-dictionary.xml’ | saxonb-xslt -ext:on -s:- -xsl:’/home/ubuntu/Documents/201008/latin-0.1.2/extract-latin-phonemes.xsl’ -o:’/home/ubuntu/Documents/201006/latin-0.1.2/latin-phonemes2′

xhb

Monday, August 9th, 2010

saxonb-xslt -ext:on -s:'/home/ubuntu/Documents/201006/german-0.1.9.5/german-0.1.9.9.xml' -xsl:'/home/ubuntu/Documents/201007/ipa-prompts/compare.xsl' -o:'/home/ubuntu/Documents/201006/audacity/xaa-folder/dummy.xml'

xeb xfa

Sunday, August 8th, 2010

saxonb-xslt -s:/home/ubuntu/Documents/201006/audacity/xeb-folder/lexicon-xeb.xml -xsl:/home/ubuntu/Documents/201006/audacity/xab-folder/copy-flac.xsl -o:/home/ubuntu/Documents/201006/audacity/xeb-folder/cp-xeb

ubuntu@ubuntu-desktop:~/Documents/201006/audacity/xeb-folder/xeb-flac-reduced$ for f in *.flac; do sox "$f" "/home/ubuntu/Documents/201006/audacity/xeb-folder/xeb-flac-reduced/wav/${f%.flac}.wav"; done

xfa

ubuntu@ubuntu-desktop:~$ saxonb-xslt -s:/home/ubuntu/Documents/201006/audacity/xfa-folder/lexicon-xfa.xml -xsl:/home/ubuntu/Documents/201006/audacity/xab-folder/copy-flac.xsl -o:/home/ubuntu/Documents/201006/audacity/xfa-folder/cp-xfa

better:
ubuntu@ubuntu-desktop:~$ saxonb-xslt -ext:on -s:/home/ubuntu/Documents/201006/audacity/xfa-folder/lexicon-xfa.xml -xsl:/home/ubuntu/Documents/201006/audacity/xab-folder/copy-flac.xsl -o:/home/ubuntu/Documents/201006/audacity/xfa-folder/cp-dummy

ubuntu@ubuntu-desktop:~/Documents/201006/audacity/xfa-folder/xfa-flac-reduced$ for f in *.flac; do sox "$f" "/home/ubuntu/Documents/201006/audacity/xfa-folder/xfa-wav-reduced/${f%.flac}.wav"; done

xca

Saturday, August 7th, 2010

$ cd /home/ubuntu/Documents/201006/audacity/xca-folder/xca-flac-reduced
mkdir wav
ubuntu@ubuntu-desktop:~/Documents/201006/audacity/xca-folder/xca-flac-reduced$ for f in *.flac; do sox “$f” “wav/${f%.flac}.wav”; done

xba

Saturday, August 7th, 2010

cd /home/ubuntu/Documents/201006/audacity/xba-folder
$ mkdir xba-flac-reduced
$ saxonb-xslt -s:/home/ubuntu/Documents/201006/audacity/xba-folder/lexicon-xba.xml -xsl:/home/ubuntu/Documents/201006/audacity/xab-folder/copy-flac.xsl -o:/home/ubuntu/Documents/201006/audacity/xba-folder/cp-xba

cp /home/ubuntu/Documents/201006/audacity/xba-folder/xba/ʔangəmɛsənhaɪ̯t.flac [...]

$ cd /home/ubuntu/Documents/201006/audacity/xba-folder/xba-flac-reduced

mkdir wav

for f in *.flac; do sox "$f" "wav/${f%.flac}.wav"; done

xad

Saturday, August 7th, 2010

ubuntu@ubuntu-desktop:~$ saxonb-xslt -s:/home/ubuntu/Documents/201006/audacity/xad-folder/lexicon-xad.xml -xsl:/home/ubuntu/Documents/201006/audacity/xab-folder/copy-flac.xsl -o:/home/ubuntu/Documents/201006/audacity/xad-folder/cp-xad

cp /home/ubuntu/Documents/201006/audacity/xad-folder/xad/adənaʊ̯ɐhaʊ̯s.flac

$ cd /home/ubuntu/Documents/201006/audacity/xad-folder/xad-flac-reduced
$ mkdir wav
$ for f in *.flac; do sox “$f” “wav/${f%.flac}.wav”; done

convert german prompts

Monday, May 24th, 2010

Reduce file size from 48 to 16 khz:

1. ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/02$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 "converted/${f%.flac}.flac"; done

2. ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/03-48khz$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “03/${f%.flac}.flac”; done

3. ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/04-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “04/${f%.flac}.flac”; done

4. ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/05-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “05/${f%.flac}.flac”; done

5. ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/06-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “06/${f%.flac}.flac”; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/07-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “07/${f%.flac}.flac”; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/08-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “08/${f%.flac}.flac”; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/09-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 “09/${f%.flac}.flac”; done

June 17, 2010: probably 10, 11, 12, 13, 14, 15 have been converted. Will continue with 16:

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/16-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "16/${f%.flac}.flac"; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/17-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 –add-comment “License is GPLv3″ “17/${f%.flac}.flac”; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/18-convert$ for f in *.flac; do sox “$f” -t flac -r 16000 -c 1 –add-comment “License is GPLv3″ “18/${f%.flac}.flac”; done

ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/18-convert$ cd /home/ubuntu/Documents/201005/ralf-de/19-convert
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/19-convert$ mkdir 19
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/19-convert$ mv prompts.xml 19/prompts.xml
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/19-convert$ geany 19/prompts.xml
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/19-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "19/${f%.flac}.flac"; done

20-26 are missing

27.
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/27-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "27/${f%.flac}.flac"; done

28.
$ cd /home/ubuntu/Documents/201005/ralf-de/28-convert
$ mkdir /home/ubuntu/Documents/201005/ralf-de/28-convert/28
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/28-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "28/${f%.flac}.flac"; done
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/28-convert$ mv /home/ubuntu/Documents/201005/ralf-de/28-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/28-convert/28

29. file:///home/ubuntu/Documents/201005/ralf-de/29-convert
cd /home/ubuntu/Documents/201005/ralf-de/29-convert
mkdir /home/ubuntu/Documents/201005/ralf-de/29-convert/29
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/29-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "29/${f%.flac}.flac"; done
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/29-convert$ mv /home/ubuntu/Documents/201005/ralf-de/29-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/29-convert/29

30. 20100815 file:///home/ubuntu/Documents/201005/ralf-de/30-convert
cd /home/ubuntu/Documents/201005/ralf-de/30-convert
mkdir /home/ubuntu/Documents/201005/ralf-de/30-convert/30
for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "30/${f%.flac}.flac"; done
mv /home/ubuntu/Documents/201005/ralf-de/30-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/30-convert/30

31. file:///home/ubuntu/Documents/201005/ralf-de/31-convert
cd /home/ubuntu/Documents/201005/ralf-de/31-convert
mkdir /home/ubuntu/Documents/201005/ralf-de/31-convert/31
for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "31/${f%.flac}.flac"; done
mv /home/ubuntu/Documents/201005/ralf-de/31-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/31-convert/31

32. ubuntu@ubuntu-desktop:~$ cd /home/ubuntu/Documents/201005/ralf-de/32-convert
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/32-convert$ mkdir /home/ubuntu/Documents/201005/ralf-de/32-convert/32
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/32-convert$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 --add-comment "License is GPLv3" "32/${f%.flac}.flac"; done
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/32-convert$ mv /home/ubuntu/Documents/201005/ralf-de/31-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/32-convert/32
mv: cannot stat `/home/ubuntu/Documents/201005/ralf-de/31-convert/prompts.xml': No such file or directory
ubuntu@ubuntu-desktop:~/Documents/201005/ralf-de/32-convert$ mv /home/ubuntu/Documents/201005/ralf-de/32-convert/prompts.xml /home/ubuntu/Documents/201005/ralf-de/32-convert/32

convert folder wav to mp3

Monday, October 12th, 2009

1.a. convert wav folder into mp3 folder; use 64kb quality; should result in not too big files:

liberty@liberty-desktop:~/200909/sprueche/xml$ for f in *.wav; do lame -V 4 -b 64 "$f" "converted/${f%.wav}.mp3"; done

the result is here: /home/liberty/200909/sprueche/xml/converted

1.b. lower quality: $ for f in *.wav; do lame -V 6 -b 48 "$f" "converted/${f%.wav}.mp3"; done

2. convert wav folder to ogg: liberty@liberty-desktop:~/200909/sprueche/store$ for f in *.wav; do sox "$f" -t ogg -r 11025 -c 1 "converted/${f%.wav}.ogg"; done

convert folder flac to wav with sox

Sunday, October 11th, 2009

the following command converts a flac file into a wav file

liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ for f in *.flac; do sox "$f" "${f%.flac}.wav"; done

which tags can be added? want to convert from 48k to 16k unsigned PCM

this worked, too: liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ sox http://script.blau.in/german/01/de1-02.flac -t flac -r 16000 -s -c 1 target02flac

what should it look like? try
$ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "${f%.flac}.wav"; done

the following works, converts a 48k flac to 16k wav: liberty@liberty-desktop:~/200910/test/ralfherzog/VoxForge$ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "${f%.flac}.wav"; done

the following works for storing in a subfolder: $ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "subfolder/${f%.flac}.wav"; done

you can store an ogg file in a subfolder: $ for f in *.flac; do sox "$f" -t ogg -r 16000 -c 1 "subfolder/${f%.flac}.ogg"; done
it seems that this ogg file has 48k not 16k as intended. why is that? no, it has 48kbps, and 16000 hertz, so probably all right. the -s option can't be used in conjunction with ogg because "can't encode Signed Integer PCM"

this converts 48k flac files to 16k flac files into a subfolder: $ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 "subfolder/${f%.flac}.flac"; done
the -s option can't be used with flac files

converted successfully the german prompts01 from 48k flac to 16k flac: liberty@liberty-desktop:~/200910/editing-ralfherzog/01$ for f in *.flac; do sox "$f" -t flac -r 16000 -c 1 "converted/${f%.flac}.flac"; done

Node 01: Useful links

Saturday, September 5th, 2009

1. http://www.thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/
2. http://en.wikipedia.org/wiki/Pulse-code_modulation
3. http://www.voip-info.org/tiki-index.php?page=Convert+WAV+audio+files+for+use+in+Asterisk

liberty@liberty-desktop:~/200909/sprueche$ for a in *.wav; do sox "$a" -t flac -r 16000 -s -c 1 `echo $a|sed "s/.wav/.flac/"` resample -ql; done

4. http://sox.sourceforge.net/soxi.html

5. man sed

6. http://www.ubuntu-forum.de/post/196028/nautilus-script-pdf-to-jpg.html#post196028

7. http://en.wikipedia.org/wiki/Regular_expression << continue here