在文件路径上实现torchaudio.info后,我得到了与文档中指定的不同的返回。
此处的代码返回<torchaudio.backend.common.AudioMetaData object at 0x000001908CFB3B20>
tempFile = os.path.join(audio_dir,'1','121007.wav')
metadata=torchaudio.info(tempFile)
print(metadata)
而我需要以下表格的回报,因为文件规定
AudioMetaData(sample_rate=44100, num_frames=109368, num_channels=2, bits_per_sample=16, encoding=PCM_S)
可能是版本问题。v0.8没有CCD_ 2方法。它是在v0.9中添加的。
https://github.com/pytorch/audio/pull/1339