All images by author.

Member-only story

Real Time Audio Wave Visualization in Python.

Or how to overcome Integration hell.

Keno Leon
Geek Culture
Published in
8 min readJun 10, 2021
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:

*Looks simple but when we add the complexities of streaming in real time from a microphone to both the GUI elements and getting the UI buttons to coordinate everything plus each libraries quirks and kinks, well let’s just say specs can be deceiving, making them can be easy but implementing them is a completely different challenge.
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 ) :

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Keno Leon
Keno Leon

Responses (1)

Write a response