How long does it take to generate a waveform in WavePlayer?

The time required to analyze the audio content of a file and generate its waveform can be affected by several factors. The most relevant one is the size of the file. Since WavePlayer needs to fully load an audio file in order to analyze its content and generate a waveform, the longer is the audio track, the longer it will take it to generate its waveform. Usually, we consider that it takes 1 or 2 seconds per minute of audio recording. So, for example, the waveform of a 5-minute track should render in 5 to 10 seconds.

Of course, also a higher bitrate will affect the time required to generate a waveform.

The player seems to load fine, but no waveform is displayed. What can I do?

Most of the times, this problem is connected to a newly uploaded file or, in any case, to a file that has never been played back by a WavePlayer instance. When WavePlayer loads a file for the very first time, it needs to analyze its audio content and generates a small peak file where it saves the waveform data. This process only takes place the very first time an audio file is loaded in WavePlayer: once the process is done, the same audio file will always load almost instantaneously.

What is a peak file?

A peak file is a small file (usually around 12kB) where WavePlayer saves the waveform data of your audio files. This allows the players on your page to display a waveform much faster than it would do if it had to analyze the actual audio content every time a file is loaded.