arse__ar_ss / local /check_librispeech.py
haoxiangsnr's picture
Add files using upload-large-folder tool
1002053 verified
raw
history blame contribute delete
657 Bytes
import os
from pathlib import Path
import pandas as pd
from tqdm import tqdm
from audiozen.acoustics.io import load_audio
librispeech_metadata_fpath = Path(
"/home/xhao/proj/audiozen/recipes/librimix_sot/local/metadata/LibriSpeech/train-clean-100.csv"
).resolve()
librispeech_metadata = pd.read_csv(librispeech_metadata_fpath, engine="python")
librispeech_dir = Path("/nfs/xhao/data/LibriSpeech").resolve()
for index, row in tqdm(librispeech_metadata.iterrows()):
origin_path = row["origin_path"]
origin_path = librispeech_dir / origin_path
assert os.path.exists(origin_path)
y, sr = load_audio(origin_path)
assert sr == 16000