فهرست منبع

remove the file at the end of the process if the user does not set the cache to True

nico 10 سال پیش
والد
کامیت
12ab8d7ee0
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      core/TTS/TTSModule.py

+ 4 - 0
core/TTS/TTSModule.py

@@ -77,6 +77,10 @@ class TTSModule(object):
         # then play the generated audio file
         self.play_audio()
 
+        # if the user don't want to keep the cache we remove the file
+        if not self.cache:
+            FileManager.remove_file(self.file_path)
+
     def _get_path_to_store_audio(self):
         """
         Get a sentence (a text) an return the full path of the file