Monday, August 5, 2019

Audio Manipulation for Speech Dataset in NN

Audio Manipulation for Speech Dataset in NN

##generate dataset using PICO and LJSPEECH Text(metadata.csv)
#total=$(wc -l < metadata.csv)
#echo $total
#count=1
#while IFS='|' read xx yy zz;do
#    pico2wave -w wavs-pico/$xx.wav "$zz"
#    echo $count
#    count=$((count+1))
#done < metadata.csv

#convert individial org dataset to 16khz
#count=1
#for i in wavs-org/*.wav
#do
#sox $i -r 16000 -c 1 wavs-org-16k/$i
#count=$((count+1))
#echo $count
#done



##convert and merge to single pcm
#count=1
#for i in wavs-org-16k/*.wav
#do
#sox $i -r 16000 -c 1 -t sw -
#count=$((count+1))
#echo $count
#done > input-org-16k.s16


#for i in wavs-pico/*.wav
#do
#filename=$(basename "$i")
#org_sample=$(soxi wavs-org-16k/$filename | grep samples | awk -F '=' '{print $2}' | awk '{print $1;}')
#pico_sample=$(soxi $i | grep samples | awk -F '=' '{print $2}' | awk '{print $1;}')
#tempo_scale=$(echo "scale=14; $pico_sample/$org_sample" | bc)
#mkdir -p wavs-pico2
#sox $i wavs-pico2/$filename tempo $tempo_scale 30
#done


#convert and merge to single pcm
count=1
for i in wavs-pico2/*.wav
do
sox $i -r 16000 -c 1 -t sw -
count=$((count+1))
echo $count
done > input-pico2.s16


#basename "${VAR}"
#for i in wavs-pico/*.wav
#do
#$i -f s16le -acodec pcm_s16le basename org-16k.pcm
#org_sample=$(soxi org-16k.wav | grep samples | awk -F '=' '{print $2}' | awk '{print $1;}')
#pico_sample=$(soxi pico.wav | grep samples | awk -F '=' '{print $2}' | awk '{print $1;}')
#echo $org_sample
#echo $pico_sample
# tempo_scale=$(echo "scale=14; $pico_sample/$org_sample" | bc)
#echo $tempo_scale

No comments:

Post a Comment

Featured Post

XDP - Getting Started with XDP (Linux)