예제 #1
0
 def stream(self):
     """Получаем поток"""
     tts = speaker(self.text, lang=self.lang)
     urls = tts.get_urls()
     url = urls[0]
     return url
예제 #2
0
 def mp3_to_text(self, _file):
     """Считываем файл и получаем текст"""
     tts = speaker(self.text, lang=self.lang)
     with open(_file, 'wb') as f:
         tts.write_to_fp(f)
예제 #3
0
 def to_play(self):
     """Проигрываем наш текст"""
     mp3_fp = BytesIO()
     tts = speaker(self.text, lang=self.lang)
     tts.write_to_fp(mp3_fp)
예제 #4
0
 def streams(self):
     """Получаем потоки"""
     tts = speaker(self.text, lang=self.lang)
     urls = tts.get_urls()
     return urls
예제 #5
0
 def to_mp3(self, _file = 'speak.mp3'):
     """Преводим текст в *.mp3"""
     tts = speaker(self.text, lang=self.lang)
     tts.save(_file)
     print(f"Создался файл {_file}") 
예제 #6
0
 def mp3_to_text(self, _file):
     tts = speaker(f'{self.text}', lang=f'{self.lang}')
     with open(f'{_file}', 'wb') as f:
         tts.write_to_fp(f)
예제 #7
0
 def stream(self):
     tts = speaker(f'{self.text}', lang=f'{self.lang}')
     urls = tts.get_urls()
     url = urls[0]
예제 #8
0
 def to_play(self):
     mp3_fp = BytesIO()
     tts = speaker(f'{self.text}', lang=f'{self.lang}')
     tts.write_to_fp(mp3_fp)
예제 #9
0
 def to_mp3(self):
     tts = speaker(f'{self.text}', lang=f'{self.lang}')
     tts.save('speak.mp3')