mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 01:06:19 +00:00
Formatting
This commit is contained in:
@@ -7,13 +7,14 @@ from abc import ABC, abstractmethod
|
|||||||
|
|
||||||
from ..BaseEngine import BaseEngine
|
from ..BaseEngine import BaseEngine
|
||||||
|
|
||||||
|
|
||||||
class Word(TypedDict):
|
class Word(TypedDict):
|
||||||
start: str
|
start: str
|
||||||
end: str
|
end: str
|
||||||
text: str
|
text: str
|
||||||
|
|
||||||
class BaseTTSEngine(BaseEngine):
|
|
||||||
|
|
||||||
|
class BaseTTSEngine(BaseEngine):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def synthesize(self, text: str, path: str) -> str:
|
def synthesize(self, text: str, path: str) -> str:
|
||||||
pass
|
pass
|
||||||
@@ -70,8 +71,10 @@ class BaseTTSEngine(BaseEngine):
|
|||||||
if audio_clip.duration > duration:
|
if audio_clip.duration > duration:
|
||||||
speed_factor = audio_clip.duration / duration
|
speed_factor = audio_clip.duration / duration
|
||||||
|
|
||||||
new_audio = audio_clip.fx(mp.vfx.speedx, speed_factor, final_duration=duration)
|
new_audio = audio_clip.fx(
|
||||||
|
mp.vfx.speedx, speed_factor, final_duration=duration
|
||||||
|
)
|
||||||
|
|
||||||
new_audio.write_audiofile(path, codec='libmp3lame')
|
new_audio.write_audiofile(path, codec="libmp3lame")
|
||||||
|
|
||||||
audio_clip.close()
|
audio_clip.close()
|
||||||
Reference in New Issue
Block a user