Skip to content

Instantly share code, notes, and snippets.

@nukeador
Created July 26, 2019 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nukeador/9704f1beaffa29ed9c003c4fe525d147 to your computer and use it in GitHub Desktop.
Save nukeador/9704f1beaffa29ed9c003c4fe525d147 to your computer and use it in GitHub Desktop.
# You need two csv files with the links to the vendor wav files
# vendor1.csv should have urls in the 5th column
# vendor2.csv should have urls in the 13th column
rm vendor1.audios.txt
rm vendor2.audios.txt
mkdir -p audios
awk -F "\"*,\"*" '{print $5}' vendor1.csv | shuf -n20 >> vendor1.audios.txt
awk -F "\"*,\"*" '{print $13}' vendor2.csv | shuf -n20 >> vendor2.audios.txt
cd audios
echo -e 'Audios are being downloaded, please wait...\n\n'
wget -q -i ../vendor1.audios.txt
wget -q -i ../vendor2.audios.txt
echo 'Average duration: '
soxi -D *.wav | awk '{ total += $1; count++ } END { print total/count }'
rm *.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment