Spaces:
Running
on
Zero
Running
on
Zero
File size: 532 Bytes
56cfa73 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from pathlib import Path
import soundfile as sf
from datasets import load_dataset
dataset = load_dataset("mythicinfinity/libritts", "clean")
for split in dataset.keys():
Path(f"libritts/{split}").mkdir(exist_ok=True)
for i, x in enumerate(dataset[split]):
# audio = x["audio"]
text = x["text_normalized"]
# wav, sr = audio["array"], audio["sampling_rate"]
# sf.write(f"libritts/{split}/{i}.wav", wav, sr)
with open(f"libritts/{split}/{i}.txt", "w") as f:
f.write(text)
|