Actually fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = edge-tts
|
name = edge-tts
|
||||||
version = 2.2.0
|
version = 2.2.1
|
||||||
author = rany
|
author = rany
|
||||||
author_email = ranygh@riseup.net
|
author_email = ranygh@riseup.net
|
||||||
description = Microsoft Edge's TTS
|
description = Microsoft Edge's TTS
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ async def list_voices():
|
|||||||
class SubMaker:
|
class SubMaker:
|
||||||
def __init__(self, overlapping=5):
|
def __init__(self, overlapping=5):
|
||||||
self.subsAndOffset = []
|
self.subsAndOffset = []
|
||||||
|
self.brokenOffset = []
|
||||||
self.overlapping = (overlapping * (10**7))
|
self.overlapping = (overlapping * (10**7))
|
||||||
|
|
||||||
def formatter(self, offset1, offset2, subdata):
|
def formatter(self, offset1, offset2, subdata):
|
||||||
@@ -85,8 +86,9 @@ class SubMaker:
|
|||||||
|
|
||||||
def createSub(self, timestamp, text):
|
def createSub(self, timestamp, text):
|
||||||
if len(self.subsAndOffset) >= 2:
|
if len(self.subsAndOffset) >= 2:
|
||||||
if self.subsAndOffset[-2] >= timestamp:
|
if self.subsAndOffset[-2] >= timestamp + sum(self.brokenOffset):
|
||||||
timestamp = timestamp + self.subsAndOffset[-2]
|
self.brokenOffset.append(self.subsAndOffset[-2])
|
||||||
|
timestamp = timestamp + sum(self.brokenOffset)
|
||||||
|
|
||||||
self.subsAndOffset.append(timestamp)
|
self.subsAndOffset.append(timestamp)
|
||||||
self.subsAndOffset.append(text)
|
self.subsAndOffset.append(text)
|
||||||
|
|||||||
Reference in New Issue
Block a user