Download TTS/tests/bash_tests/test_resample.sh from MrAR/tts_trainer: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/datasets/MrAR/tts_trainer/resolve/main/TTS/tests/bash_tests/test_resample.sh
- Command line
-
hf download hf://datasets/MrAR/tts_trainer/TTS/tests/bash_tests/test_resample.sh
-
curl -L -o test_resample.sh https://huggingface.co/datasets/MrAR/tts_trainer/resolve/main/TTS/tests/bash_tests/test_resample.sh
634 Bytes
| set -xe | |
| BASEDIR=$(dirname "$0") | |
| TARGET_SR=16000 | |
| echo "$BASEDIR" | |
| #run the resample script | |
| python TTS/bin/resample.py --input_dir $BASEDIR/../data/ljspeech --output_dir $BASEDIR/outputs/resample_tests --output_sr $TARGET_SR | |
| #check samplerate of output | |
| OUT_SR=$( (echo "import librosa" ; echo "y, sr = librosa.load('"$BASEDIR"/outputs/resample_tests/wavs/LJ001-0012.wav', sr=None)" ; echo "print(sr)") | python ) | |
| OUT_SR=$(($OUT_SR + 0)) | |
| if [[ $OUT_SR -ne $TARGET_SR ]]; then | |
| echo "Missmatch between target and output sample rates" | |
| exit 1 | |
| fi | |
| #cleaning up | |
| rm -rf $BASEDIR/outputs/resample_tests | |