This is a nice project, I mentioned it on the tutorial as it was something i was planning to do but not yet got around to. Looking at it now, I’m not sure how to go about it either.
the “stream” I mentioned there might in fact be the stream that’s available when loading from an audio stream – I think you can see the current data/access the stream as a file device. But that doesn’t really help for showing what is currently playing.
But all is not lost. There is actually a very nice PyQt5 media player with graphic equalizer called Milkplayer. If you look at the visualizer code what they do there is open the same file in a separate thread using pydub. The QMediaPlayer current positions are used to extract regions of the audio, which is then processed to generate the equalizer.
You could do something similar, and just return the total amplitude instead – Each AudioSegment in pydub has a . dBFS property which gives you the loudness.
Hope that helps? I’ll update the tutorial when I’m back in the office next week.