added backup contingency
This commit is contained in:
1 parent
aeafb53da3
commit
2b0d66f451
1 file changed
+6
-3
@@ -114,9 +114,12 @@ class TTSEngine:
|
||||
# self.length += MP3(f"{self.path}/{filename}.mp3").info.length
|
||||
# except (MutagenError, HeaderNotFoundError):
|
||||
# self.length += sox.file_info.duration(f"{self.path}/{filename}.mp3")
|
||||
clip = AudioFileClip(f"{self.path}/{filename}.mp3")
|
||||
self.length += clip.duration
|
||||
clip.close()
|
||||
try:
|
||||
clip = AudioFileClip(f"{self.path}/{filename}.mp3")
|
||||
self.length += clip.duration
|
||||
clip.close()
|
||||
except:
|
||||
self.length = 0
|
||||
|
||||
|
||||
def process_text(text: str):
|
||||
|
||||
Reference in new issue
Block a user