36 lines
876 B
Python
36 lines
876 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Iterable, List
|
|
from .models import Segment
|
|
|
|
|
|
class Transcriber(ABC):
|
|
@abstractmethod
|
|
def transcribe(self, audio_path: str, srt_out: str) -> Iterable[Segment]:
|
|
pass
|
|
|
|
|
|
class Translator(ABC):
|
|
@abstractmethod
|
|
def translate_srt(self, in_srt: str, out_srt: str) -> None:
|
|
pass
|
|
|
|
|
|
class TTSClient(ABC):
|
|
@abstractmethod
|
|
def synthesize_from_srt(self, srt_path: str, out_wav: str, **kwargs) -> None:
|
|
pass
|
|
|
|
|
|
class AudioProcessor(ABC):
|
|
@abstractmethod
|
|
def extract_audio(self, video_path: str, out_wav: str) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def replace_audio_in_video(self, video_path: str, audio_path: str, out_video: str) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def burn_subtitles(self, video_path: str, srt_path: str, out_video: str) -> None:
|
|
pass
|