summaryrefslogtreecommitdiffstats
path: root/Scripts/transcribe_pipeline.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-10-05 18:22:55 -0700
committeryum <yum.food.vr@gmail.com>2023-10-05 18:28:42 -0700
commitadd7bd8ef86ec21cd1327eb45bcb739aa54f7db8 (patch)
treef342e37917c93073552854a125696e12afbd4c39 /Scripts/transcribe_pipeline.py
parentc2bc70c18d2fd1c3601b32f2a93b3b4a704786a5 (diff)
Transcripts preceding long pauses now dropv0.16.0
When hot-miking into the built-in chatbox, there are sometimes long pauses in conversation. After these pauses, it's undesirable to show the transcript generate before the pause. This feature makes it so that those transcripts can be dropped. Also: * Limit number of segments sent to browser source to 10. Allow this to grow up to 10 segments before dropping the first 5 segments. * Silence warnings generated by `install_in_venv`, used by e.g. translation codepath. * Enable audio normalization to improve accuracy when speaking softly, at the cost of some accuracy when speaking normally. Credit: user endo0269 on Discord suggested this feature.
Diffstat (limited to 'Scripts/transcribe_pipeline.py')
-rw-r--r--Scripts/transcribe_pipeline.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Scripts/transcribe_pipeline.py b/Scripts/transcribe_pipeline.py
index 3f48b08..5914afc 100644
--- a/Scripts/transcribe_pipeline.py
+++ b/Scripts/transcribe_pipeline.py
@@ -5,15 +5,22 @@ class TranscriptCommit:
def __init__(self,
delta: str,
preview: str,
- latency_s: int = None,
+ latency_s: float = None,
thresh_at_commit: int = None,
- audio: bytes = None):
+ audio: bytes = None,
+ duration_s: float = None,
+ start_ts: float = None):
self.delta = delta
self.preview = preview
self.latency_s = latency_s
self.thresh_at_commit = thresh_at_commit
self.audio = audio
+ # Time at which the commit is generated
self.ts = time.time()
+ # Time corresponding to the start of the segment
+ self.start_ts = start_ts
+ # The duration of the audio segment, in seconds.
+ self.duration_s = duration_s
class StreamingPlugin: