mirror of
https://github.com/patw/AudioSumma.git
synced 2025-09-04 11:40:34 +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 sys
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
import pyaudio
|
import pyaudio
|
||||||
import wave
|
import wave
|
||||||
import threading
|
import threading
|
||||||
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QInputDialog, QLabel
|
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QInputDialog, QLabel
|
||||||
from PyQt5.QtGui import QIcon, QPixmap
|
from PyQt5.QtGui import QIcon, QPixmap
|
||||||
|
import summarize
|
||||||
|
|
||||||
class RecordingApp(QWidget):
|
class RecordingApp(QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -104,7 +104,12 @@ class RecordingApp(QWidget):
|
||||||
print(f"Audio saved to {file_path}")
|
print(f"Audio saved to {file_path}")
|
||||||
|
|
||||||
def transcribe(self):
|
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):
|
def clean(self):
|
||||||
print("Cleaning files...")
|
print("Cleaning files...")
|
||||||
|
|
Loading…
Add table
Reference in a new issue