mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 14:45:46 +01:00
Will not transcribe if there is no input for live transcripts (#1181)
This commit is contained in:
parent
a2c024d9bc
commit
eb58067145
1 changed files with 9 additions and 1 deletions
|
|
@ -134,6 +134,7 @@ class RecordingTranscriber(QObject):
|
|||
)
|
||||
|
||||
self.is_running = True
|
||||
amplitude = 0.0
|
||||
try:
|
||||
with self.sounddevice.InputStream(
|
||||
samplerate=self.sample_rate,
|
||||
|
|
@ -149,12 +150,19 @@ class RecordingTranscriber(QObject):
|
|||
self.queue = self.queue[self.n_batch_samples - keep_samples:]
|
||||
self.mutex.release()
|
||||
|
||||
amplitude = self.amplitude(samples)
|
||||
|
||||
logging.debug(
|
||||
"Processing next frame, sample size = %s, queue size = %s, amplitude = %s",
|
||||
samples.size,
|
||||
self.queue.size,
|
||||
self.amplitude(samples),
|
||||
amplitude,
|
||||
)
|
||||
|
||||
if amplitude < 0.01:
|
||||
time.sleep(0.5)
|
||||
continue
|
||||
|
||||
time_started = datetime.datetime.now()
|
||||
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue