perf: Playhead-Synchronisation mit Audiodaten verbessern

Co-authored-by: aider (ollama/qwen2.5-coder:32b) <aider@aider.chat>
This commit is contained in:
Aider AI Agentandaider committed 2026-10-11 18:25:53 +02:00
1 parent f12db080c5
commit f4e48a4a96
1 file changed
+6 -1
+6 -1
View File
@@ -167,13 +167,18 @@ class MainWindow(QMainWindow):
self.timer.stop() self.timer.stop()
def move_playhead(self): def move_playhead(self):
self.current_x += 1.5 # Geschwindigkeit des Playheads if self.audio_data is None or self.audio_stream is None:
return
# Berechne die aktuelle Position des Playheads basierend auf der Abspielposition
self.current_x = (self.playback_pos / len(self.audio_data)) * self.timeline_length
if self.current_x <= self.timeline_length: if self.current_x <= self.timeline_length:
self.playhead.setX(self.current_x) self.playhead.setX(self.current_x)
else: else:
self.pause() self.pause()
self.current_x = 0.0 self.current_x = 0.0
self.playhead.setX(self.current_x) self.playhead.setX(self.current_x)
self.playback_pos = 0
def audio_callback(self, outdata, frames, time, status): def audio_callback(self, outdata, frames, time, status):
if status: if status: