There are several examples on SO about how to plot a real-time wave form of an audio signal. (For instance: Waveform visualization in JavaScript from audio.)
I have a slightly different goal, and I'm not sure if it's possible.
I am building a transcription application, and I want to plot a trace of the amplitude of the waveform (rather like this screenshot).
The thing is, I don't know how long the audio will be, so, I don't know how large my canvas needs to be if I plot it in real time.
Is the only solution to load the whole audio file and check its length before building the canvas?