Skip to content

Instantly share code, notes, and snippets.

@JIElite
Created September 22, 2023 16:18
Show Gist options
  • Save JIElite/d92da86211ef1bd4782401aa3ac876a0 to your computer and use it in GitHub Desktop.
Save JIElite/d92da86211ef1bd4782401aa3ac876a0 to your computer and use it in GitHub Desktop.
def __iter__(self)
# self.raw_list: record the absolute path for each wav file
for path in self.raw_list:
wav_tensor, sample_rate = torchaudio.load(path)
yield dict(wav=wav_tensor, sample_rate=sample_rate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment