Python Forum
matplotlib for better waveform display - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: matplotlib for better waveform display (/thread-29012.html)



matplotlib for better waveform display - jefflawr - Aug-14-2020

Hi,
I'm trying to use matplotlib for audio waveforms to duplicate some of the features of Audacity. The two things I like are:
1. a moving line over the wave-form as the audio plays, associating position with sound
2. real-time graphing, revealing graph at the same time as the associated audio plays.

Graphing chunks in python is slow (bordering on slower than the audio), so I don't want to use python to play and graph chunk by chunk. Matplotlib graphs whole files nice and fast but I can't found matplotlib documentation that discusses either a "slow-motion plot" or a moving position line over a current graph.

My next efforts will focus on getting #1 by plotting a line on a second transparent layer above the graph but I welcome any informed suggestions as to how that might work or what's a better approach.
As for #2, I'm completely in the dark and would appreciate any suggestions on how to achieve it.
Thanks for the brain cycles,

Jeff