perf: Playhead-Synchronisation mit Audiodaten verbessern
Co-authored-by: aider (ollama/qwen2.5-coder:32b) <aider@aider.chat>
This commit is contained in:
1 parent
f12db080c5
commit
f4e48a4a96
1 file changed
+6
-1
@@ -167,13 +167,18 @@ class MainWindow(QMainWindow):
|
||||
self.timer.stop()
|
||||
|
||||
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:
|
||||
self.playhead.setX(self.current_x)
|
||||
else:
|
||||
self.pause()
|
||||
self.current_x = 0.0
|
||||
self.playhead.setX(self.current_x)
|
||||
self.playback_pos = 0
|
||||
|
||||
def audio_callback(self, outdata, frames, time, status):
|
||||
if status:
|
||||
|
||||
Reference in new issue
Block a user