You can use the audiowaveform program. For example, let's generate peaks for a MP3 file called 'long_clip.mp3'.
Generate JSON-formatted peaks data from the file long_clip.mp3:
audiowaveform -i long_clip.mp3 -o long_clip.json --pixels-per-second 20 --bits 8
Then normalize the peak data so the values stay between 0 and 1 using the Python script below: