mirror of
https://github.com/SevaSk/ecoute.git
synced 2024-12-20 05:07:53 +00:00
updated clear method
This commit is contained in:
parent
02d1f12c76
commit
e0caf957e5
@ -105,4 +105,10 @@ class AudioTranscriber:
|
|||||||
|
|
||||||
def clear_transcript_data(self):
|
def clear_transcript_data(self):
|
||||||
self.transcript_data["You"].clear()
|
self.transcript_data["You"].clear()
|
||||||
self.transcript_data["Speaker"].clear()
|
self.transcript_data["Speaker"].clear()
|
||||||
|
|
||||||
|
self.audio_sources["You"]["last_sample"] = bytes()
|
||||||
|
self.audio_sources["Speaker"]["last_sample"] = bytes()
|
||||||
|
|
||||||
|
self.audio_sources["You"]["new_phrase"] = True
|
||||||
|
self.audio_sources["Speaker"]["new_phrase"] = True
|
6
main.py
6
main.py
@ -28,8 +28,10 @@ def update_response_UI(responder, textbox, update_interval_slider_label, update_
|
|||||||
|
|
||||||
textbox.after(300, update_response_UI, responder, textbox, update_interval_slider_label, update_interval_slider)
|
textbox.after(300, update_response_UI, responder, textbox, update_interval_slider_label, update_interval_slider)
|
||||||
|
|
||||||
def clear_transcript(transcriber):
|
def clear_context(transcriber, audio_queue):
|
||||||
transcriber.clear_transcript_data()
|
transcriber.clear_transcript_data()
|
||||||
|
with audio_queue.mutex:
|
||||||
|
audio_queue.queue.clear()
|
||||||
|
|
||||||
def create_ui_components(root):
|
def create_ui_components(root):
|
||||||
ctk.set_appearance_mode("dark")
|
ctk.set_appearance_mode("dark")
|
||||||
@ -91,7 +93,7 @@ def main():
|
|||||||
root.grid_columnconfigure(1, weight=1)
|
root.grid_columnconfigure(1, weight=1)
|
||||||
|
|
||||||
# Add the clear transcript button to the UI
|
# Add the clear transcript button to the UI
|
||||||
clear_transcript_button = ctk.CTkButton(root, text="Clear Transcript", command=lambda: clear_transcript(global_transcriber, ))
|
clear_transcript_button = ctk.CTkButton(root, text="Clear Transcript", command=lambda: clear_context(global_transcriber, audio_queue, ))
|
||||||
clear_transcript_button.grid(row=1, column=0, padx=10, pady=3, sticky="nsew")
|
clear_transcript_button.grid(row=1, column=0, padx=10, pady=3, sticky="nsew")
|
||||||
|
|
||||||
update_transcript_UI(global_transcriber, transcript_textbox)
|
update_transcript_UI(global_transcriber, transcript_textbox)
|
||||||
|
Loading…
Reference in New Issue
Block a user