[Freeswitch-users] Proper prompt gain/level
Bryan Smart
bryansmart at bryansmart.com
Wed Jun 29 06:12:43 MSD 2011
Hi, Michael.
Thanks for posting this.
Have you considered using the higher quality sample rate conversion features in new versions of sox?
A starting place for info is here:
http://sox.sourceforge.net/SoX/Resampling
Perhaps change:
sox -v 0.2 $base_dir/$dir/$filename -r $rate -c 1 $tmp_dir/$voice_dir/$dir/$rate/$filename
to:
sox $base_dir/$dir/$filename -c 1 $tmp_dir/$voice_dir/$dir/$rate/$filename rate -v -I $rate dither
rate -v -I $rate: Replaces -r $rate. Uses the newer "very high quality" mode (instead of "high quality") with Intermediate Phase response (instead of linear). This setting is superior to the default, but slower to process.
dither: Applies basic triangular dithering. There are other dithering strategies, but, based on what I've read and experienced, they aren't as useful when down-sampling to low rates.
Might produce slightly higher quality files, the next time it is necessary to regenerate them.
Bryan
On Jun 28, 2011, at 11:18 AM, Michael Collins wrote:
You can download the 48kHz files from files.freeswitch.org<http://files.freeswitch.org/>. The script itself is nothing special - all it does is cycle through the target sampling rates and run each file through sox. Here's a copy of the script:
base_dir="48000"
rates="48000 32000 16000 8000"
version="1.0.16"
voice="en-us-callie"
voice_dir="en/us/callie"
tar_path="../../.."
tmp_dir="tmp"
CWD=`pwd`
for rate in $rates; do \
mkdir -p $tmp_dir/$voice_dir
for dir in `ls $base_dir`; do \
test -d $tmp_dir/$voice_dir/$dir/$rate || mkdir -p $tmp_dir/$voice_dir/$dir/$rate; \
for filename in `ls $base_dir/$dir`; do \
echo sox -v 0.2 $base_dir/$dir/$filename -r $rate -c 1 $tmp_dir/$voice_dir/$dir/$rate/$filename; \
sox -v 0.2 $base_dir/$dir/$filename -r $rate -c 1 $tmp_dir/$voice_dir/$dir/$rate/$filename; \
done ; \
done ; \
cd $tmp_dir
echo tar -cvzf $CWD/$tar_path/freeswitch-sounds-$voice-$rate-$version.tar.gz *; \
tar -cvzf $CWD/$tar_path/freeswitch-sounds-$voice-$rate-$version.tar.gz *; \
cd -
rm -rf $tmp_dir
done
cd $tar_path
for rate in $rates; do \
openssl dgst -sha1 freeswitch-sounds-$voice-$rate-$version.tar.gz > freeswitch-sounds-$voice-$rate-$version.tar.gz.sha1 ; \
openssl dgst -md5 freeswitch-sounds-$voice-$rate-$version.tar.gz > freeswitch-sounds-$voice-$rate-$version.tar.gz.md5 ; \
done
cd $CWD
Let me know if you have any suggestions.
-MC
On Mon, Jun 27, 2011 at 8:25 PM, Bryan Smart <bryansmart at bryansmart.com<mailto:bryansmart at bryansmart.com>> wrote:
-v is a multiplier. So, -v 0.2 reduces gain to 20% of original.
It is typical to supply professionally recorded audio with peaks boosted to 0DBFS. That is probably how the prompts were originally supplied. It makes since that -v 0.2 would reduce the max power to 20%, around -15 to -16 DBFS.
The FS build process downloads pre-processed versions of these files. Is there somewhere online that I can find the source recordings+script that produces the pre-processed files that are downloaded by the build process?
Bryan
On Jun 27, 2011, at 7:32 PM, Michael Collins wrote:
On Mon, Jun 27, 2011 at 3:07 PM, Anthony Minessale <anthony.minessale at gmail.com<mailto:anthony.minessale at gmail.com>> wrote:
Have a look at the 48khz versions of the files, those should be the originals.
Someone runs a batch sox command on them to get them to the other levels.
Just for the record, the sox command used to normalize the sounds is:
sox -v 0.2 $file_in -r $rate -c 1 $file_out
The -v format is the "volume" format and if I read the sox man page correctly it means a "linear amplitude adjustment". What I can't tell from the man page is whether .2 means "reduce by 20%" or "reduce to 20%" or something else. In any case, like Tony says, we are not picky about this as long as it's not pointlessly loud.
-MC
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com<http://www.cluecon.com/> 877-7-4ACLUE
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org<http://www.freeswitch.org/>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com<http://www.cluecon.com/> 877-7-4ACLUE
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org<http://www.freeswitch.org/>
_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110628/c1adb9ef/attachment-0001.html
More information about the FreeSWITCH-users
mailing list