|
From: Pascal G. <evi...@gm...> - 2012-07-21 12:06:32
|
On Sat, Jul 21, 2012 at 12:17 AM, Hendrikus Godvliet
<hen...@gm...> wrote:
> Michael
>
> mkdir spectrogram
> for f in *.wav ;do sox "$f" -n spectrogram -o spectrogram/"$f.png" ;done
>
> And with:
> display "filename.png"
> will show you the spetrogram image
>
> ore all together:
> cd spectrogram
> for f in *.png ;do display "$f" ;done
>
> with "alt - f4" you close the image an the nex image will show up.
>
>
> Hendrikus
>
>
>
> On Sat, Jul 21, 2012 at 4:05 AM, Michael Karr <mic...@gm...>
> wrote:
>>
>> Hello,
>>
>> I'm new to scripting and I have a large collection of audio files (around
>> 5000 samples) that I want to produce a spectrogram of. So if I want to
>> apply the command:
>> sox $1.wav -n spectrogram -m -o $1.png,
>> to all the files in my folder, what would be the proper syntax?
>>
>> Cheers, Michael
Almost there.
To get exactly what he asked for, I'd go with:
for i in *.wav; do sox $i -n spectrogram -m -o ${i%%.wav}.png; done
This assumes that the shell is either bash or dash.
Cheers,
-Pascal
--
Homepage (http://organact.mine.nu)
Debian GNU/Linux (http://www.debian.org)
COMunité/LACIME: École de technologie supérieure (http://www.comunite.ca)
Integrated Microsystems Laboratory: McGill (http://www.iml.ece.mcgill.ca)
|