I need to extract the sound wave envelope from a set of audio files in a batch job on a headless Linux host.
I think this can be achieved using the Nyquist programming language, a variant of Lisp notably embedded in audacity, and dedicated to sound processing. However, if I have some familiarities with Lisp, I don't have any previous experience with Nyquist.
Is there some primitive in Nyquist to achieve that directly? Or how can I write a short Nyquist program to extract the envelope of a sound?
I tried using the snd-avg function. But it does not seem to produce a smooth envelope (upper half in the screenshot):
(snd-avg
(aref *track* 0) ; first sound
(truncate (/ *sound-srate* 50)) ; 50 Hz to samples
1 op-peak) ; follow peak values