Does anyone auto-level voicemail sound files?

Hi, I run a voicemail service using Asterisk, and would like to raise the volume of “soft talkers”.

I was thinking that after the voicemail was left, I’d make a program call to sox, and try to appropriately adjust the volume. Has anyone done this, and if so do you have any recommended sox parameters to use?

Thanks.

make an AGI script by using the following script and try to call in your dialplan. This script will adjust all the soundfiles in the directory

Adjusting the volume
After cutting the prompts and saving them (audacity works nice for that), this little script makes sure that all the voice prompts have more-or-less the same (maximum) volume:

#!/bin/sh
tmpfile=/tmp/rescale$$.wav
for i in *.wav; do
scale=$(sox “$i” /tmp/foo.wav stat -v 2>&1)
if [ $scale != “1.000” ]; then
echo -n "Rescale $i…"
cp “$i” $tmpfile
sox $tmpfile -v $scale “$i”

 echo

fi
done

check the path setting according to your requirement.

Great, thank you - I’ll try that.

One thing that might interfere with this, is that the loudest part of the call is the person hanging up at the end. Because of that the rescale command might be fooled into thinking the hangup is the peak of the call. Do you know a way around that? Ideally, I’d like to programitically remove the hang-up sound at the end of the call.