Add new logging invocation for in-progress VOSK monitoring, as well as migrate to f-string syntax for rest of buscribe.

pull/476/head
Kim 2 weeks ago committed by Mike Lang
parent f0fb2fb281
commit a001e913e3

@ -55,6 +55,8 @@ def transcribe_segments(segments: list, sample_rate: int, recognizer: BuscribeRe
if line_start_time > start_of_transcript:
write_line(result_json, line_start_time, line_end_time, db_cursor)
logging.info(f"Line successfully written for duration {line_end_time - line_start_time}")
if stopping.is_set():
return segments_end_time

@ -61,18 +61,18 @@ def main(channel, database="", base_dir=".",
logging.error("Couldn't figure out start time!")
db_conn.close()
exit(1)
logging.info("Start time: {}".format(start_time))
logging.info(f"Start time: {start_time}")
if end_time is not None:
end_time = dateutil.parse(end_time)
logging.info("End time: {}".format(end_time))
logging.info(f"End time: {end_time}")
logging.info("Loading models...")
recognizer = BuscribeRecognizer(SAMPLE_RATE, model, spk_model)
logging.info("Models loaded.")
logging.info('Transcribing from {}'.format(start_time))
logging.info(f'Transcribing from {start_time}')
# Start priming the recognizer if possible
start_of_transcription = start_time

@ -1,7 +1,7 @@
from vosk import Model, SpkModel, KaldiRecognizer
class BuscribeRecognizer():
class BuscribeRecognizer:
segments_start_time = None
def __init__(self, sample_rate=48000, model_path="model_small", spk_model_path="spk_model"):

Loading…
Cancel
Save