def synthesize(self, text): """ Synthesize the text and returns it in a string with audio in default format and sample rate. """ wav = b"" try: if text: text = self.preprocessing.process(text) mp3 = self.get_tts_mp3(self.cfg['TTS']['SpeechTech']['voice'], text) wav = audio.convert_mp3_to_wav(self.cfg, mp3) wav = audio.change_tempo(self.cfg, self.cfg['TTS']['SpeechTech']['tempo'], wav) # if self.cfg['TTS']['debug']: # m = "TTS cache hits %d and misses %d " % (self.get_tts_mp3.hits, self.get_tts_mp3.misses) # self.cfg['Logging']['system_logger'].debug(m) return wav else: return b"" except TTSException as e: m = unicode(e) + " Text: %s" % text self.cfg['Logging']['system_logger'].exception(m) return b"" return wav
def synthesize(self, text): """ Synthesize the text and returns it in a string with audio in default format and sample rate. """ try: if text: text = self.preprocessing.process(text) mp3 = self.get_tts_mp3( self.cfg['TTS']['Google']['language'], text, self.cfg['TTS']['Google'].get('tempo', 1.0)) wav = audio.convert_mp3_to_wav(self.cfg, mp3) wav = audio.change_tempo(self.cfg, self.cfg['TTS']['Google']['tempo'], wav) return wav else: return b"" except TTSException as e: m = unicode(e) + " Text: %s" % text self.cfg['Logging']['system_logger'].exception(m) return b""
def synthesize(self, text): """ Synthesize the text and returns it in a string with audio in default format and sample rate. """ wav = b"" try: if text: text = self.preprocessing.process(text) mp3 = self.get_tts_mp3(self.cfg['TTS']['Google']['language'], text, self.cfg['TTS']['Google'].get('tempo', 1.0)) wav = audio.convert_mp3_to_wav(self.cfg, mp3) wav = audio.change_tempo(self.cfg, self.cfg['TTS']['Google']['tempo'], wav) return wav else: return b"" except TTSException as e: m = unicode(e) + " Text: %s" % text self.cfg['Logging']['system_logger'].exception(m) return b"" return wav
def synthesize(self, text): """ Synthesize the text and returns it in a string with audio in default format and sample rate. """ wav = b"" try: if text: text = self.preprocessing.process(text) mp3 = self.get_tts_mp3(self.cfg['TTS']['SpeechTech']['voice'], text) wav = audio.convert_mp3_to_wav(self.cfg, mp3) wav = audio.change_tempo( self.cfg, self.cfg['TTS']['SpeechTech']['tempo'], wav) # if self.cfg['TTS']['debug']: # m = "TTS cache hits %d and misses %d " % (self.get_tts_mp3.hits, self.get_tts_mp3.misses) # self.cfg['Logging']['system_logger'].debug(m) return wav else: return b"" except TTSException as e: m = unicode(e) + " Text: %s" % text self.cfg['Logging']['system_logger'].exception(m) return b"" return wav
def synthesize(self, text): """\ Synthesizes the text and returns it as a string with audio in default format and sample rate. """ try: text = self.preprocessing.process(text) wav = self.get_tts_wav(self.cfg['TTS']['Flite']['voice'], text) wav = audio.change_tempo(self.cfg, self.cfg['TTS']['Flite']['tempo'], wav) except TTSException: m = e + "Text: %" % text self.cfg['Logging']['system_logger'].exception(m) return b"" return wav