# Download LJ Speech dataset
wget https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2 \
  -O "$ROOT_DIR/LJSpeech-1.1.tar.bz2"
  
# Unpack LJ Speech dataset
rm -rf "$ROOT_DIR/LJSpeech-1.1"
mkdir -p "$ROOT_DIR/LJSpeech-1.1"
tar -xf "$ROOT_DIR/LJSpeech-1.1.tar.bz2" -C "$ROOT_DIR"

wget https://zenodo.org/record/7499098/files/grids.zip \
  -O "$ROOT_DIR/LJSpeech-1.1-transcriptions.zip"

rm -rf "$ROOT_DIR/dataset"
unzip "$ROOT_DIR/LJSpeech-1.1-transcriptions.zip" -d "$ROOT_DIR/dataset"

rsync -am --include='*.wav' -f 'hide,! */' --links $ROOT_DIR/LJSpeech-1.1/ "$ROOT_DIR/dataset"

mv "$ROOT_DIR/dataset/wavs" "$ROOT_DIR/dataset/Linda Johnson;2;eng;North American"
