How do I add RIFF header to MP3 files programatically?
Question
More information about what I want to do here; http://www.studiodust.com/riffmp3.html
I want a way so that my control panel (made with Perl and Webmin) can do this automatically. Right now I have to rely on system
calls and have a binary for Linux. Is there a library that does it for Perl or some other language?
What's the best way of doing this?
Solution 2
The website I reference had the answer I needed. I didn't know they made a linux variant.
OTHER TIPS
I know nothing about RIFF files or their structure, uses, etc. But did you try searching CPAN? The first result looks pretty promising.
I have the following script for the exact thing you asked about.
#!/bin/bash
echo "$1"
ffmpeg -y -i "$1" -f wav out.wav > /dev/null 2>&1 && \
normalize-audio -q out.wav && \
lame --silent -a -m m --cbr -b 64 -q 0 out.wav out.mp3 && \
ffmpeg -y -i out.mp3 -f wav -acodec copy "$1" > /dev/null 2>&1 && \
echo "done."
rm out.wav out.mp3
Just edit the parameters to lame or just use the ffmpeg call and you're set.