yum-slop/TaSTT

Free self-hosted STT for VRChat.

git clone https://git.yummers.dev/yum-slop/TaSTT

yumTranscripts preceding long pauses now dropadd7bd8

v0.21.0
920 B35 linesraw
1import time
2
3
4class TranscriptCommit:
5    def __init__(self,
6            delta: str,
7            preview: str,
8            latency_s: float = None,
9            thresh_at_commit: int = None,
10            audio: bytes = None,
11            duration_s: float = None,
12            start_ts: float = None):
13        self.delta = delta
14        self.preview = preview
15        self.latency_s = latency_s
16        self.thresh_at_commit = thresh_at_commit
17        self.audio = audio
18        # Time at which the commit is generated
19        self.ts = time.time()
20        # Time corresponding to the start of the segment
21        self.start_ts = start_ts
22        # The duration of the audio segment, in seconds.
23        self.duration_s = duration_s
24
25
26class StreamingPlugin:
27    def __init__(self):
28        pass
29
30    def transform(self, commit: TranscriptCommit) -> TranscriptCommit:
31        return commit
32
33    def stop(self):
34        pass
35