It wouldn't take a long time as it reads in small pieces of the file, produces the wave graph for that small piece then reads in another small piece etc, etc. so even if you have a very large wave file it still displays the wave graph as the file is being read instead of reading in the entire file first which is what the first example does. It's as close as I could get to real-time without it being true real-time.

I have another example using audio streaming which might be of interest but it is intergrated into a larger client/server application so extracting out the code could be a task.