Created
January 20, 2023 03:46
-
-
Save SimZhou/7eef2c79ca19e0f005864eddfeed686b to your computer and use it in GitHub Desktop.
Bash script to convert all wav.ark from a wav.scp file into .wav
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
speed=100 | |
if [ $# != 2 ];then | |
echo "[ERROR] Usage: $0 wav.scp(archived) outdir" && exit 1 | |
fi | |
wavscp=$1 | |
outdir=$2 | |
mkdir -p $outdir | |
i=0 | |
while read line; do | |
utt=$(echo $line | cut -d " " -f 1) | |
ark_path=$(echo $line | cut -d " " -f 2) | |
wav-copy $ark_path ${outdir}/${utt}.wav & | |
i=$(($i+1));flag=$(($i%$speed));if [ $flag = 0 ]; then wait; fi | |
done < $wavscp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment