feat: Mono-Funktion hinzugefügt

Co-authored-by: aider (ollama/qwen2.5-coder:14b) <aider@aider.chat>
This commit is contained in:
danielandaider committed 2026-10-11 17:46:18 +02:00
1 parent c4c5ff0b20
commit 8b1bd21c2e
1 file changed
+4 -2
+4 -2
View File
@@ -79,8 +79,10 @@ class MainWindow(QMainWindow):
if file_path: if file_path:
try: try:
self.audio_data, self.sample_rate = sf.read(file_path) self.audio_data, self.sample_rate = sf.read(file_path)
if len(self.audio_data.shape) != 2: if len(self.audio_data.shape) == 1:
raise ValueError("Die WAV-Datei muss Stereo sein.") self.audio_data = self.audio_data.reshape(-1, 1) # Mono zu Stereo konvertieren
elif len(self.audio_data.shape) != 2:
raise ValueError("Die WAV-Datei muss Stereo oder Mono sein.")
except Exception as e: except Exception as e:
print(f"Fehler beim Laden der WAV-Datei: {e}") print(f"Fehler beim Laden der WAV-Datei: {e}")
self.audio_data = None self.audio_data = None