UI looks a bit better now

This commit is contained in:
Pat Wendorf 2024-06-24 09:38:54 -04:00
parent fe50d40fce
commit cb00762378
6 changed files with 16 additions and 4 deletions

View file

@ -2,6 +2,8 @@
Record your local audio and summarize it with whisper.cpp and llama.cpp! Open source, local on-prem transcription and summarization!
![Main UI](screenshot.png)
## Installation
```

BIN
headphones.png Normal file

Binary file not shown.

After

(image error) Size: 3.4 KiB

View file

@ -4,23 +4,30 @@ import subprocess
import pyaudio
import wave
import threading
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QInputDialog
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QInputDialog, QLabel
from PyQt5.QtGui import QIcon, QPixmap
class RecordingApp(QWidget):
def __init__(self):
super().__init__()
self.initUI()
self.recording_pixmap = QPixmap("recording.png")
self.not_recording_pixmap = QPixmap("notrecording.png")
self.is_recording = False
self.audio_thread = None
self.stream = None
self.p = None
self.wf = None
self.initUI()
def initUI(self):
self.setWindowTitle('Meeting Recorder')
self.setGeometry(500, 500, 500, 150)
layout = QVBoxLayout()
layout = QHBoxLayout()
self.status_label = QLabel(self)
self.status_label.setPixmap(self.not_recording_pixmap)
layout.addWidget(self.status_label)
self.record_button = QPushButton('Record', self)
self.record_button.clicked.connect(self.toggle_recording)
@ -47,6 +54,7 @@ class RecordingApp(QWidget):
if ok and filename:
self.is_recording = True
self.record_button.setText('Stop Recording')
self.status_label.setPixmap(self.recording_pixmap)
self.audio_thread = threading.Thread(target=self.record_audio, args=(filename,))
self.audio_thread.start()
@ -54,6 +62,7 @@ class RecordingApp(QWidget):
if self.is_recording:
self.is_recording = False
self.record_button.setText('Record')
self.status_label.setPixmap(self.not_recording_pixmap)
if self.audio_thread:
self.audio_thread.join()
if self.stream:
@ -114,6 +123,7 @@ class RecordingApp(QWidget):
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("headphones.png"))
ex = RecordingApp()
ex.show()
sys.exit(app.exec_())

BIN
notrecording.png Normal file

Binary file not shown.

After

(image error) Size: 2.5 KiB

BIN
recording.png Normal file

Binary file not shown.

After

(image error) Size: 2.6 KiB

BIN
screenshot.png Normal file

Binary file not shown.

After

(image error) Size: 7 KiB