
Member-only story
Real Time Audio Wave Visualization in Python.
Or how to overcome Integration hell.
Why read this? You want to visualize audio in realtime with Python and find the whole thing intimidating (like I did !) or you might be having problems integrating complex libraries and want to hear a tall tale of how I solve mine along with some tips.
What are we building ?
We are building a simple* audio waveform viewer from scratch ( explanation forthcoming ), importantly we want to see this waveform in real time in part because it’s cool and in part because we are visual beings and so this would help us better understand sound ( plus it is the pathway to more complex applications )…
Spec sketch:

By necessity integration is a complex thing, not only do you have to know about the thing you are building but also have a good understanding of the libraries you are going to use to achieve your project, in this case I've written some introductory posts on the required individual components and leave them here as suggested/complementary reading.UIs in Python with PySimpleGUIIntegrating PyAudio & PySimpleGUICustom made plots in Python with PySimpleGUIIntegrating PyPlot and PySimpleGUIHearing for robots and AISo integration tip #1: Make and test individual components (the parts) that you think you will need to make your final project, you might not end up using all of them and that is fine.
In my case I needed to know how to use PyAudio to capture the sound from my laptops microphone and somehow make sense and get that data into the GUI ( PySimpleGUI in this case) ; this is the final script of that part ( check the full post for a step by step ) :