| 1 |
#!/bin/sh |
| 2 |
#####################################################-*-mode:shell-script-*- |
| 3 |
## ## |
| 4 |
## Carnegie Mellon University and ## |
| 5 |
## Alan W Black and Kevin A. Lenzo ## |
| 6 |
## Copyright (c) 1998-2000 ## |
| 7 |
## All Rights Reserved. ## |
| 8 |
## ## |
| 9 |
## Permission is hereby granted, free of charge, to use and distribute ## |
| 10 |
## this software and its documentation without restriction, including ## |
| 11 |
## without limitation the rights to use, copy, modify, merge, publish, ## |
| 12 |
## distribute, sublicense, and/or sell copies of this work, and to ## |
| 13 |
## permit persons to whom this work is furnished to do so, subject to ## |
| 14 |
## the following conditions: ## |
| 15 |
## 1. The code must retain the above copyright notice, this list of ## |
| 16 |
## conditions and the following disclaimer. ## |
| 17 |
## 2. Any modifications must be clearly marked as such. ## |
| 18 |
## 3. Original authors' names are not deleted. ## |
| 19 |
## 4. The authors' names are not used to endorse or promote products ## |
| 20 |
## derived from this software without specific prior written ## |
| 21 |
## permission. ## |
| 22 |
## ## |
| 23 |
## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ## |
| 24 |
## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ## |
| 25 |
## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ## |
| 26 |
## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ## |
| 27 |
## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ## |
| 28 |
## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ## |
| 29 |
## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ## |
| 30 |
## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ## |
| 31 |
## THIS SOFTWARE. ## |
| 32 |
## ## |
| 33 |
########################################################################### |
| 34 |
### ## |
| 35 |
### Generate (filled) pitchmark file from waveform files ## |
| 36 |
### ## |
| 37 |
############################################################################ |
| 38 |
|
| 39 |
if [ $# = 0 ] |
| 40 |
then |
| 41 |
echo "Make pm files from waveforms" |
| 42 |
echo "Usage: bin/make_pm_wave wav/*.wav" |
| 43 |
echo "This will require editing of parameters to get a good result" |
| 44 |
exit 1 |
| 45 |
fi |
| 46 |
|
| 47 |
if [ ! "$ESTDIR" ] |
| 48 |
then |
| 49 |
echo "environment variable ESTDIR is unset" |
| 50 |
echo "set it to your local speech tools directory e.g." |
| 51 |
echo ' bash$ export ESTDIR=/home/awb/projects/speech_tools/' |
| 52 |
echo or |
| 53 |
echo ' csh% setenv ESTDIR /home/awb/projects/speech_tools/' |
| 54 |
exit 1 |
| 55 |
fi |
| 56 |
|
| 57 |
# Modification by Milan Zamazal <[email protected]>: Ensure locales don't break number printing. |
| 58 |
unset LC_ALL |
| 59 |
export LC_NUMERIC=C |
| 60 |
|
| 61 |
PM_ARGS='-min 0.0057 -max 0.012 -def 0.01 -wave_end -lx_lf 140 -lx_lo 111 -lx_hf 80 -lx_ho 51 -med_o 0' |
| 62 |
|
| 63 |
for i in $* |
| 64 |
do |
| 65 |
fname=`basename $i .wav` |
| 66 |
echo $i PM_WAVE |
| 67 |
$ESTDIR/bin/ch_wave -scaleN 0.9 $i -F 16000 -o tmp$$.wav |
| 68 |
# You may (or may not) require -inv and many of the parameters here |
| 69 |
# may be worth modifying, see the section on Extracting pitchmarks from |
| 70 |
# waveforms in the document |
| 71 |
$ESTDIR/bin/pitchmark tmp$$.wav -o pm/$fname.pm -otype est $PM_ARGS -fill |
| 72 |
rm -f tmp$$.wav |
| 73 |
done |
| 74 |
|