From: <aut...@us...> - 2012-12-04 02:33:19
|
Revision: 489 http://upstage.svn.sourceforge.net/upstage/?rev=489&view=rev Author: aut-upstage Date: 2012-12-04 02:33:12 +0000 (Tue, 04 Dec 2012) Log Message: ----------- Gavin/Scott - updated voices in regards to martins changes Modified Paths: -------------- branches/2.4.2/upstage/voices.py Modified: branches/2.4.2/upstage/voices.py =================================================================== --- branches/2.4.2/upstage/voices.py 2012-12-04 02:25:05 UTC (rev 488) +++ branches/2.4.2/upstage/voices.py 2012-12-04 02:33:12 UTC (rev 489) @@ -45,23 +45,30 @@ echo_in = ''#cat | ' #"read SPEECH ; echo $SPEECH |" #Heath Behrens readded the -x switch used for byte switching as it breaks some voices. -fest_lame = " | %s lame -S --quiet -m s -s %%s --resample 22.05 - $1 " % timeout +#fest_lame = " | %s lame -S --quiet -m s -s %%s --resample 22.05 - $1 " % timeout +fest_lame = " | %s lame -S --quiet -m s -s %%s --resample 44.10 - $1 " % timeout rsynth_lame = " | %s lame -S --quiet -m m -r -s 11.025 --preset phone - $1 " % timeout -espeak_mbrola_lame = " %s lame -S --quiet -m m -s 16 --resample 22.05 --preset phone $1.wav $1" % timeout - +#espeak_mbrola_lame = " | %s lame -S --quiet -m m -s 16 --resample 22.05 --preset phone $1.wav $1" % timeout +espeak_mbrola_lame = "%s lame -S --quiet -m m -s 16 --resample 22.05 --preset phone $1.wav $1" % timeout # espeak doesn't seem to like piping to stdout, so it saves to tmp file instead espeak_lame = " %s lame -S --quiet -m m -s 22.05 --preset phone $1.wav $1 " % timeout espeak_cleanup = " rm $1.wav " #Heath Behrens - Need to declare to possible paths for mbrola voices. -path_to_embrola = " /usr/local/share/mbrola/" +path_to_embrola = "/usr/share/mbrola/" #Heath Behrens - this is the path to some of the voices that install in a different location. #The other option is to simply copy all voices from the folder to the previous folder. -path_to_embrola_alt = "/usr/local/share/mbrola/voices" +path_to_embrola_alt = "/usr/share/mbrola/voices" -text2wave = '/usr/local/share/festvox/festival/bin/text2wave' +# freshly downloaded mbrola voices +# cause: "Binary error", see: http://tcts.fpms.ac.be/synthesis/mbrola/mbrfaq.html#Q2 +path_to_embrola_voices = "/usr/local/share/mbrola/" +# FIXME: seems unused right now! +#text2wave = '/usr/local/share/festvox/festival/bin/text2wave' +text2wave = '/usr/local/src/festival/bin/text2wave' + #these functions are run over the definitions in VOICE_KIT, below, to #create the appropriate shell script for each voice. @@ -77,6 +84,14 @@ (fest_lame % hz), log)) return [s] +# manually installed festival 2.1 +# TODO: check that the correct "text2wave" ist used! +def _festival3(voice, hz, options=''): + s = ''.join((echo_in, timeout, "/usr/local/src/festival/bin/text2wave -eval '%s' " % voice, + options, " -otype wav - -o - ", log, + (fest_lame % hz), log)) + return [s] + def _rsynth(options): exe = find_executable('rsynth-say') if not exe: @@ -103,8 +118,11 @@ mbrola = find_executable('mbrola') if not espeak or not mbrola: return None + #s = ''.join((echo_in, timeout, espeak, " -k27 -v ", voice, options, " --stdin ", log, + # " | ", mbrola, " -e ", mboptions, " " + path_to_embrola, mbvoice, + # " - $1.wav ", log)) s = ''.join((echo_in, timeout, espeak, " -k27 -v ", voice, options, " --stdin ", log, - " | ", mbrola, " -e ", mboptions, path_to_embrola, mbvoice, + " | ", mbrola, " -e ", mboptions, " " + path_to_embrola_voices, mbvoice, " - $1.wav ", log)) return [s, espeak_mbrola_lame, espeak_cleanup] @@ -113,48 +131,94 @@ VOICE_KIT = { #Shaun Narayan (01/23/10) - Changed sampling rate (from 16 to 8) for all festival voices as after voices bug fix they were too fast #debian packaged festival/mbrola: - 'default': (_festival, ('(voice_us1_mbrola)', 8 )), - 'roger': (_festival, ('(voice_en1_mbrola)', 8)), - 'bud': (_festival, ('(voice_us2_mbrola)', 8)), - 'randy': (_festival, ('(voice_us3_mbrola)', 8)), + #'default': (_festival, ('(voice_us1_mbrola)', 8 )), + #'roger': (_festival, ('(voice_en1_mbrola)', 8)), + #'bud': (_festival, ('(voice_us2_mbrola)', 8)), + #'randy': (_festival, ('(voice_us3_mbrola)', 8)), + # ------ + 'default': (_festival, ('(voice_us1_mbrola)', 16)), + 'roger': (_festival, ('(voice_en1_mbrola)', 16)), + 'bud': (_festival, ('(voice_us2_mbrola)', 16)), + 'randy': (_festival, ('(voice_us3_mbrola)', 16)), #debian packaged festival/festival - 'kal': (_festival, ('(voice_kal_diphone)', 8)), - 'ked': (_festival, ('(voice_ked_diphone)', 8)), - 'rab': (_festival, ('(voice_rab_diphone)', 8)), - 'don': (_festival, ('(voice_don_diphone)', 5)), + #'kal': (_festival, ('(voice_kal_diphone)', 8)), + #'ked': (_festival, ('(voice_ked_diphone)', 8)), + #'rab': (_festival, ('(voice_rab_diphone)', 8)), + #'don': (_festival, ('(voice_don_diphone)', 5)), + # ------ + 'kal': (_festival, ('(voice_kal_diphone)', 16)), + 'ked': (_festival, ('(voice_ked_diphone)', 16)), + 'rab': (_festival, ('(voice_rab_diphone)', 16)), + 'don': (_festival, ('(voice_don_diphone)', 16)), #compiled festival - 'slt_cmu': (_festival2, ('(voice_cmu_us_slt_arctic_clunits)', 8)), - 'slt_nitech': (_festival2, ('(voice_nitech_us_slt_arctic_hts)', 8)), - 'awb_cmu': (_festival2, ('(voice_cmu_us_awb_arctic_clunits)', 8)), - 'awb_nitech': (_festival2, ('(voice_nitech_us_awb_arctic_hts)', 8)), - 'clb_nitech': (_festival2, ('(voice_nitech_us_clb_arctic_hts)', 8)), - 'bdl_cmu': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8)), - 'bdl_nitech': (_festival2, ('(voice_nitech_us_bdl_arctic_hts)', 8)), - 'jmk_cmu': (_festival2, ('(voice_cmu_us_jmk_arctic_clunits)', 8)), - 'jmk_nitech': (_festival2, ('(voice_nitech_us_jmk_arctic_hts)', 8)), - 'rms_nitech': (_festival2, ('(voice_nitech_us_rms_arctic_hts)', 8)), - 'rms_faster': (_festival2, ('(voice_nitech_us_rms_arctic_hts)', 8, " -F 11025")), + #'slt_cmu': (_festival2, ('(voice_cmu_us_slt_arctic_clunits)', 8)), + #'slt_nitech': (_festival2, ('(voice_nitech_us_slt_arctic_hts)', 8)), + #'awb_cmu': (_festival2, ('(voice_cmu_us_awb_arctic_clunits)', 8)), + #'awb_nitech': (_festival2, ('(voice_nitech_us_awb_arctic_hts)', 8)), + #'clb_nitech': (_festival2, ('(voice_nitech_us_clb_arctic_hts)', 8)), + #'bdl_cmu': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8)), + #'bdl_nitech': (_festival2, ('(voice_nitech_us_bdl_arctic_hts)', 8)), + #'jmk_cmu': (_festival2, ('(voice_cmu_us_jmk_arctic_clunits)', 8)), + #'jmk_nitech': (_festival2, ('(voice_nitech_us_jmk_arctic_hts)', 8)), + #'rms_nitech': (_festival2, ('(voice_nitech_us_rms_arctic_hts)', 8)), + #'rms_faster': (_festival2, ('(voice_nitech_us_rms_arctic_hts)', 8, " -F 11025")), + # ----- + 'slt_cmu': (_festival3, ('(voice_cmu_us_slt_arctic_hts)', 16)), + 'slt_nitech': (_festival3, ('(voice_nitech_us_slt_arctic_hts)', 16)), + 'awb_cmu': (_festival3, ('(voice_cmu_us_awb_arctic_hts)', 16)), + 'awb_nitech': (_festival3, ('(voice_nitech_us_awb_arctic_hts)', 16)), + 'clb_nitech': (_festival3, ('(voice_nitech_us_clb_arctic_hts)', 16)), + 'bdl_cmu': (_festival3, ('(voice_cmu_us_bdl_arctic_hts)', 16)), + 'bdl_nitech': (_festival3, ('(voice_nitech_us_bdl_arctic_hts)', 16)), + 'jmk_cmu': (_festival3, ('(voice_cmu_us_jmk_arctic_hts)', 16)), + 'jmk_nitech': (_festival3, ('(voice_nitech_us_jmk_arctic_hts)', 16)), + 'rms_nitech': (_festival3, ('(voice_nitech_us_rms_arctic_hts)', 16)), + # rms does not work "faster" + #'rms_faster': (_festival3, ('(voice_nitech_us_rms_arctic_hts)', 8, " -F 11.025")), ###Shaun Narayan (02/22/10) - New voices - 'bdl_cmu': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8)), - 'ksp_cmu': (_festival2, ('(voice_cmu_us_ksp_arctic_clunits)', 8)), - 'rms_cmu': (_festival2, ('(voice_cmu_us_rms_arctic_clunits)', 8)), - 'kal_cmu': (_festival2, ('(voice_cmu_us_kal_com_clunits)', 8)), - 'kal_cmu_faster': (_festival2, ('(voice_cmu_us_kal_com_clunits)', 8, " -F 11025")), - 'bdl_cmu_faster': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8, " -F 11025")), - 'ksp_cmu_faster': (_festival2, ('(voice_cmu_us_ksp_arctic_clunits)', 8, " -F 11025")), - 'rms_cmu_faster': (_festival2, ('(voice_cmu_us_rms_arctic_clunits)', 8, " -F 11025")), - 'slt_cmu_faster': (_festival2, ('(voice_cmu_us_slt_arctic_clunits)', 8, " -F 11025")), - 'slt_nitech_faster': (_festival2, ('(voice_nitech_us_slt_arctic_hts)', 8, " -F 11025")), - 'awb_cmu_faster': (_festival2, ('(voice_cmu_us_awb_arctic_clunits)', 8, " -F 11025")), - 'awb_nitech_faster': (_festival2, ('(voice_nitech_us_awb_arctic_hts)', 8, " -F 11025")), - 'clb_nitech_faster': (_festival2, ('(voice_nitech_us_clb_arctic_hts)', 8, " -F 11025")), - 'bdl_cmu_faster': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8, " -F 11025")), - 'bdl_nitech_faster': (_festival2, ('(voice_nitech_us_bdl_arctic_hts)', 8, " -F 11025")), - 'jmk_cmu_faster': (_festival2, ('(voice_cmu_us_jmk_arctic_clunits)', 8, " -F 11025")), - 'jmk_nitech_faster': (_festival2, ('(voice_nitech_us_jmk_arctic_hts)', 8, " -F 11025")), + #'bdl_cmu': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8)), + #'ksp_cmu': (_festival2, ('(voice_cmu_us_ksp_arctic_clunits)', 8)), + #'rms_cmu': (_festival2, ('(voice_cmu_us_rms_arctic_clunits)', 8)), + #'kal_cmu': (_festival2, ('(voice_cmu_us_kal_com_clunits)', 8)), + #'kal_cmu_faster': (_festival2, ('(voice_cmu_us_kal_com_clunits)', 8, " -F 11025")), + #'bdl_cmu_faster': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8, " -F 11025")), + #'ksp_cmu_faster': (_festival2, ('(voice_cmu_us_ksp_arctic_clunits)', 8, " -F 11025")), + #'rms_cmu_faster': (_festival2, ('(voice_cmu_us_rms_arctic_clunits)', 8, " -F 11025")), + #'slt_cmu_faster': (_festival2, ('(voice_cmu_us_slt_arctic_clunits)', 8, " -F 11025")), + #'slt_nitech_faster': (_festival2, ('(voice_nitech_us_slt_arctic_hts)', 8, " -F 11025")), + #'awb_cmu_faster': (_festival2, ('(voice_cmu_us_awb_arctic_clunits)', 8, " -F 11025")), + #'awb_nitech_faster': (_festival2, ('(voice_nitech_us_awb_arctic_hts)', 8, " -F 11025")), + #'clb_nitech_faster': (_festival2, ('(voice_nitech_us_clb_arctic_hts)', 8, " -F 11025")), + #'bdl_cmu_faster': (_festival2, ('(voice_cmu_us_bdl_arctic_clunits)', 8, " -F 11025")), + #'bdl_nitech_faster': (_festival2, ('(voice_nitech_us_bdl_arctic_hts)', 8, " -F 11025")), + #'jmk_cmu_faster': (_festival2, ('(voice_cmu_us_jmk_arctic_clunits)', 8, " -F 11025")), + #'jmk_nitech_faster': (_festival2, ('(voice_nitech_us_jmk_arctic_hts)', 8, " -F 11025")), + # ------ + # bdl_cmu already defined: commented out + #'bdl_cmu': (_festival3, ('(voice_cmu_us_bdl_arctic_hts)', 16)), + # ksp and rms do not work: + #'ksp_cmu': (_festival3, ('(voice_cmu_us_ksp_arctic_hts)', 16)), + #'rms_cmu': (_festival3, ('(voice_cmu_us_rms_arctic_hts)', 16)), + # kal_cmu does not exist: commented out + #'kal_cmu': (_festival3, ('(voice_cmu_us_kal_com_hts)', 16)), + # all "faster" versions commented out, as they will not work (without sox or similar) + #'kal_cmu_faster': (_festival3, ('(voice_cmu_us_kal_com_hts)', 16, " -F 8000")), + #'bdl_cmu_faster': (_festival3, ('(voice_cmu_us_bdl_arctic_hts)', 8, " -F 8000")), + #'ksp_cmu_faster': (_festival3, ('(voice_cmu_us_ksp_arctic_hts)', 8, " -F 8000")), + #'rms_cmu_faster': (_festival3, ('(voice_cmu_us_rms_arctic_hts)', 8, " -F 8000")), + #'slt_cmu_faster': (_festival3, ('(voice_cmu_us_slt_arctic_hts)', 8, " -F 8000")), + #'slt_nitech_faster': (_festival3, ('(voice_nitech_us_slt_arctic_hts)', 8, " -F 8000")), + #'awb_cmu_faster': (_festival3, ('(voice_cmu_us_awb_arctic_hts)', 8, " -F 8000")), + #'awb_nitech_faster': (_festival3, ('(voice_nitech_us_awb_arctic_hts)', 8, " -F 8000")), + #'clb_nitech_faster': (_festival3, ('(voice_nitech_us_clb_arctic_hts)', 8, " -F 8000")), + #'bdl_cmu_faster': (_festival3, ('(voice_cmu_us_bdl_arctic_hts)', 8, " -F 8000")), + #'bdl_nitech_faster': (_festival3, ('(voice_nitech_us_bdl_arctic_hts)', 8, " -F 8000")), + #'jmk_cmu_faster': (_festival3, ('(voice_cmu_us_jmk_arctic_hts)', 8, " -F 8000")), + #'jmk_nitech_faster': (_festival3, ('(voice_nitech_us_jmk_arctic_hts)', 8, " -F 8000")), + #rsynth: 'slow': (_rsynth, (" -x 1200 -S 3 ",)), 'high': (_rsynth, (" -x 2800 -S 1.4 ",)), @@ -165,7 +229,8 @@ 'e_en': (_espeak, ("en/en ",)), #'e_en-croak': (_espeak, ("en/en-croak ",)), 'e_en-n': (_espeak, ("en/en-n ",)), - 'e_en-r': (_espeak, ("en/en-r ",)), + #'e_en-r': (_espeak, ("en/en-r ",)), + 'e_en-r': (_espeak, ("en/en-us ",)), 'e_en-rp': (_espeak, ("en/en-rp ",)), 'e_en-sc': (_espeak, ("en/en-sc ",)), 'e_en-wm': (_espeak, ("en/en-wm ",)), @@ -175,13 +240,15 @@ #'e_en-croak+11': (_espeak, ("en/en-croak+11 ",)), 'e_en-n-f2': (_espeak, ("en/en-n+12 ",)), - 'e_en-r-f3': (_espeak, ("en/en-r+13 ",)), + #'e_en-r-f3': (_espeak, ("en/en-r+13 ",)), + 'e_en-r-f3': (_espeak, ("en/en-us+13 ",)), 'e_en-rp-f1': (_espeak, ("en/en-rp+11 ",)), 'e_en-sc-f1': (_espeak, ("en/en-sc+11 ",)), 'e_en-wm-f1': (_espeak, ("en/en-wm+11 ",)), #'e_en-croak-f4': (_espeak, ("en/en-croak+14 ",)), 'e_en-n-f4': (_espeak, ("en/en-n+14 ",)), - 'e_en-r-f4': (_espeak, ("en/en-r+14 ",)), + #'e_en-r-f4': (_espeak, ("en/en-r+14 ",)), + 'e_en-r-f4': (_espeak, ("en/en-us+14 ",)), 'e_en-rp-f4': (_espeak, ("en/en-rp+14 ",)), 'e_en-sc-f4': (_espeak, ("en/en-sc+14 ",)), 'e_en-wm-f4': (_espeak, ("en/en-wm+14 ",)), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |