Compare commits
2 Commits
776d95f8cd
...
78881a572d
| Author | SHA1 | Date | |
|---|---|---|---|
|
78881a572d
|
|||
|
0a808a8471
|
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "pyvtt"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
description = "Python Voice to Text + LLMA"
|
||||
authors = [{ name = "Max P.", email = "Mail@MPassarello.de" }]
|
||||
license = { text = "MIT" }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
@@ -95,12 +96,25 @@ class WhisperWorker(QThread):
|
||||
print("Kein Ollama Prompt angegeben, nur Whisper Ergebnis verwendet.")
|
||||
|
||||
# Ergebnis ins Clipboard kopieren
|
||||
try:
|
||||
subprocess.run(["wl-copy"], input=formatted_result.encode(), check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Clipboard Fehler: {e}")
|
||||
notify("Fehler", "Ein Fehler beim Kopieren des Ergebnisses ist aufgetreten!")
|
||||
return
|
||||
if CURRENT_PRESET["mode"] == "journal":
|
||||
today = datetime.date.today().strftime("%Y.%m.%d")
|
||||
journal_path = os.path.join(CONFIGURATION["journal_path"], f"{today} - {CURRENT_PRESET['journal_name']}.md")
|
||||
now = datetime.datetime.now().strftime("%H:%M")
|
||||
try:
|
||||
with open(journal_path, "a") as f:
|
||||
f.write(f"## {now}\n")
|
||||
f.write(f"{formatted_result}\n\n")
|
||||
except Exception as e:
|
||||
print(f"Journal Fehler: {e}")
|
||||
notify("Fehler", "Ein Fehler beim Schreiben ins Journal ist aufgetreten!")
|
||||
return
|
||||
else:
|
||||
try:
|
||||
subprocess.run(["wl-copy"], input=formatted_result.encode(), check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Clipboard Fehler: {e}")
|
||||
notify("Fehler", "Ein Fehler beim Kopieren des Ergebnisses ist aufgetreten!")
|
||||
return
|
||||
|
||||
notify("Spracherkennung", "Transkription abgeschlossen!")
|
||||
play_sound()
|
||||
|
||||
Reference in New Issue
Block a user