diff options
| author | yum <yum.food.vr@gmail.com> | 2025-07-24 18:48:44 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-07-24 18:48:44 -0700 |
| commit | 5df013d26eb13ed4aef8d16aa14346e0f9be5111 (patch) | |
| tree | f30400042304cd8d8531b45873d068d826418ddc /app | |
| parent | 9a699c784501ed0d3c62a3485c898a3794580c48 (diff) | |
Sanitize transcript before putting in filename
Diffstat (limited to 'app')
| -rw-r--r-- | app/stt.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -693,7 +693,8 @@ class VadCommitter: if self.cfg["save_audio"] and len(delta) > 0: ts = datetime.fromtimestamp(self.collector.now() - latency_s) - filename = str(ts.strftime('%Y_%m_%d__%H-%M-%S')) + delta.strip() + ".wav" + sanitized_delta = ''.join(c for c in delta.strip() if c.isalnum() or c == ' ') + filename = str(ts.strftime('%Y_%m_%d__%H-%M-%S')) + sanitized_delta + ".wav" audio_dir = os.path.join(PROJECT_ROOT, "audio") if not os.path.exists(audio_dir): os.makedirs(audio_dir) |
