mirror of
https://github.com/rany2/edge-tts
synced 2024-11-22 01:45:02 +00:00
Actually fix
This commit is contained in:
parent
5f02c6a5cc
commit
6fbf875673
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = edge-tts
|
||||
version = 2.2.0
|
||||
version = 2.2.1
|
||||
author = rany
|
||||
author_email = ranygh@riseup.net
|
||||
description = Microsoft Edge's TTS
|
||||
|
@ -76,6 +76,7 @@ async def list_voices():
|
||||
class SubMaker:
|
||||
def __init__(self, overlapping=5):
|
||||
self.subsAndOffset = []
|
||||
self.brokenOffset = []
|
||||
self.overlapping = (overlapping * (10**7))
|
||||
|
||||
def formatter(self, offset1, offset2, subdata):
|
||||
@ -85,8 +86,9 @@ class SubMaker:
|
||||
|
||||
def createSub(self, timestamp, text):
|
||||
if len(self.subsAndOffset) >= 2:
|
||||
if self.subsAndOffset[-2] >= timestamp:
|
||||
timestamp = timestamp + self.subsAndOffset[-2]
|
||||
if self.subsAndOffset[-2] >= timestamp + sum(self.brokenOffset):
|
||||
self.brokenOffset.append(self.subsAndOffset[-2])
|
||||
timestamp = timestamp + sum(self.brokenOffset)
|
||||
|
||||
self.subsAndOffset.append(timestamp)
|
||||
self.subsAndOffset.append(text)
|
||||
|
Loading…
Reference in New Issue
Block a user