zmbfeng commited on
Commit
5eac09d
·
1 Parent(s): ecc8964

check audio directory, if not there creat one

Browse files
Files changed (1) hide show
  1. avatar.py +3 -0
avatar.py CHANGED
@@ -113,6 +113,9 @@ class Avatar:
113
 
114
  def create_mel_from_audio(self,input_text):
115
  tts = gTTS(text=input_text, lang="en")
 
 
 
116
  tts.save(f"{self.output_audio_path}input_audio.mp3")
117
  sound = AudioSegment.from_mp3(f"{self.output_audio_path}input_audio.mp3")
118
 
 
113
 
114
  def create_mel_from_audio(self,input_text):
115
  tts = gTTS(text=input_text, lang="en")
116
+ if not os.path.exists(self.output_audio_path):
117
+ print(f"{self.output_audio_path} does not exist, creating one")
118
+ os.makedirs(self.output_audio_path)
119
  tts.save(f"{self.output_audio_path}input_audio.mp3")
120
  sound = AudioSegment.from_mp3(f"{self.output_audio_path}input_audio.mp3")
121