Spaces:
Runtime error
Runtime error
check audio directory, if not there creat one
Browse files
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 |
|