|
From: Michael M. <mic...@gm...> - 2014-04-19 04:56:45
|
I'm creating a simple little sound file editor, which includes the ability to play a sound file as a vertical line (a "cursor") moves across the plot of the waveform in sync with the sound. So the trick is, how to create this moving line. First I tried FuncAnimation, but I had problems with the synchronization with the sound. I'm guessing that the animation capabilities of matplotlib weren't really designed to be synchronized with outside activities. So then I tried using QTimer's and modifying the Line2D instance that is the vertical bar. This didn't work unless I called draw() on the figure canvas every time I modified the Line2D, which caused slowdown (probably because my audio data consists of 1000's of points). So is there a way to animate a vertical line moving across the plot with good control over exact timing, in the presence of other plots with thousands of points? Mike |