mirror of
https://github.com/patw/AudioSumma.git
synced 2025-04-23 17:19:09 +00:00
Treat the summarizer as a module now, and call it with threading instead of subprocess
This commit is contained in:
parent
3c05cd78dd
commit
ac27eaf826
1 changed files with 7 additions and 2 deletions
|
@ -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...")
|
||||
|
|
Loading…
Add table
Reference in a new issue