示例#1
0
 def test_en(self):
     with open(path.join(self.data_folder, "hello.pho")) as pho_file:
         pho_list = PhonemeList(pho_file.read())
         self.assertEqual(pho_list.phonemes_str, "h@l@U__")
         wav_byte = Voice(lang="en").to_audio(pho_list)
     with open(path.join(self.data_folder, "hello_from_pho.wav"), "rb") as wavfile:
         self.assertEqual(wavfile.read(), wav_byte)
示例#2
0
 def test_fr(self):
     with open(path.join(self.data_folder, "salut.pho")) as pho_file:
         pho_list = PhonemeList.from_pho_str(pho_file.read())
         self.assertEqual(pho_list.phonemes_str, "saly__")
         wav_byte = Voice(lang="fr", voice_id=4).to_audio(pho_list)
     with open(path.join(self.data_folder, "salut_from_pho.wav"),
               "rb") as wavfile:
         self.assertEqual(wavfile.read(), wav_byte)
示例#3
0
 def test_all_fr(self):
     voice = Voice(lang="fr", speed=110, pitch=60, voice_id=1)
     wav_byte = voice.to_audio("PK LA VIE")
     with open(path.join(self.data_folder, "params_all.wav"),
               "rb") as wavfile:
         self.assertEqual(wavfile.read(), wav_byte)
示例#4
0
 def test_hallo(self):
     voice = Voice(lang="de")
     wav_byte = voice.to_audio("Hallo Freunde")
     with open(path.join(self.data_folder, "hallo.wav"), "rb") as wavfile:
         self.assertEqual(wavfile.read(), wav_byte)
示例#5
0
 def test_salut(self):
     voice = Voice(lang="fr")
     wav_byte = voice.to_audio("Salut les amis")
     with open(path.join(self.data_folder, "salut.wav"), "rb") as wavfile:
         self.assertEqual(wavfile.read(), wav_byte)
示例#6
0
 def test_german(self):
     voice = Voice(lang="de")
     self.assertEqual(voice.to_phonemes("hallo").phonemes_str, "halo:__")
示例#7
0
 def test_english_letter_n(self):
     voice = Voice(lang="en")
     self.assertEqual(voice.to_phonemes("second").phonemes_str, "sek@nd__")
示例#8
0
 def test_english(self):
     voice = Voice(lang="en")
     self.assertEqual(voice.to_phonemes("hello").phonemes_str, "h@l@U__")
示例#9
0
 def test_french(self):
     voice = Voice(lang="fr")
     self.assertEqual(voice.to_phonemes("bonjour").phonemes_str, "bo~ZuR__")