Update edge-tts to version 4.0.11

* Add pylint check for lint.sh
* Change overlapping default from 5second to 1second for SubMaker and util.py
* Default to WordBoundary for edge-playback (from SentenceBoundary)
* Drop SentenceBoundary support (never works properly and too many hacks)
  - No longer actually supported by Azure's official SDK for a few years
    already
* Stop attempting to correct broken offsets sent back to us by Azure
  - Fixes never work properly because AI voice sometimes takes odd pauses
    at the start and sometimes doesn't do so. It's never predictable and
    cannot be fixed on the library's end.
  - Solution is for Microsoft to fix the integer overflow bug they are facing
    in the {Word,Sentence}Boundary offsets. It doesn't affect us until we reach
    30min long TTS anyway.
* Have edge-tts --list-voices use the configured HTTP proxy
* More misc changes and fixes
This commit is contained in:
rany2
2022-05-29 18:08:16 +03:00
parent 9a20f1ca90
commit 797d04f182
7 changed files with 53 additions and 67 deletions

View File

@@ -39,7 +39,7 @@ class SubMaker:
SubMaker class
"""
def __init__(self, overlapping=5):
def __init__(self, overlapping=1):
"""
SubMaker constructor.
@@ -48,7 +48,6 @@ class SubMaker:
subtitles should overlap.
"""
self.subs_and_offset = []
self.broken_offset = 0
self.overlapping = overlapping * (10**7)
def create_sub(self, timestamp, text):
@@ -64,13 +63,6 @@ class SubMaker:
None
"""
timestamp[1] += timestamp[0]
if len(self.subs_and_offset) >= 2:
if self.subs_and_offset[-2][1] >= timestamp[0] + self.broken_offset:
self.broken_offset = self.subs_and_offset[-2][1]
timestamp[0] += self.broken_offset
timestamp[1] += self.broken_offset
self.subs_and_offset.append(timestamp)
self.subs_and_offset.append(text)