espnet2.fileio.datadir_writer.DatadirWriter
Less than 1 minute
espnet2.fileio.datadir_writer.DatadirWriter
class espnet2.fileio.datadir_writer.DatadirWriter(p: Path | str)
Bases: object
Writer class to create kaldi like data directory.
Examples
>>> with DatadirWriter("output") as writer:
... # output/sub.txt is created here
... subwriter = writer["sub.txt"]
... # Write "uttidA some/where/a.wav"
... subwriter["uttidA"] = "some/where/a.wav"
... subwriter["uttidB"] = "some/where/b.wav"
close()