The pipeline requires a dataset of stereo audio files where:
- Left channel: Audio generated by Moshi.
- Right channel: User input.
Dataset Structure
- A
.jsonl file listing all files with their paths and durations. - For every
.wav file, a corresponding .json file containing the transcript with timestamps.
Example directory structure:
data/
├── mycooldataset.jsonl
└── data_stereo
├── a.json
├── a.wav
├── b.json
├── b.wav
Generating the .jsonl file
You can generate the .jsonl manifest using the following Python snippet:
import sphn
import json
from pathlib import Path
paths = [str(f) for f in Path("wav-dir").glob("*.wav")]
durations = sphn.durations(paths)
with open("data.jsonl", "w") as fobj:
for p, d in zip(paths, durations):
if d is None:
continue
json.dump({"path": p, "duration": d}, fobj)
fobj.write("\n")
Annotating transcripts
To generate the required .json transcript files for your audio, run the annotate.py script:
python annotate.py {your_jsonl_file}
This script supports SLURM for distributed annotation using --shards and --partition flags.
python annotate.py {your_jsonl_file}