Treat the summarizer as a module now, and call it with threading instead of subprocess

This commit is contained in:
Pat Wendorf 2024-08-19 07:55:46 -04:00
parent 3c05cd78dd
commit ac27eaf826

View file

@ -1,11 +1,11 @@
import sys
import os
import subprocess
import pyaudio
import wave
import threading
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QInputDialog, QLabel
from PyQt5.QtGui import QIcon, QPixmap
import summarize
class RecordingApp(QWidget):
def __init__(self):
@ -104,7 +104,12 @@ class RecordingApp(QWidget):
print(f"Audio saved to {file_path}")
def transcribe(self):
subprocess.Popen(['python', 'summarize.py'])
# Run the transcription and summarization in the background
threading.Thread(target=self.run_transcription_and_summarization).start()
def run_transcription_and_summarization(self):
summarize.process_wav_files()
summarize.summarize_transcripts()
def clean(self):
print("Cleaning files...")