更新时间:2022-06-07 23:51:10
使用glob
模块并向其传递一个模式(例如*.wav
或任何命名的文件).它将返回符合条件或模式的文件列表.
Use the glob
module and pass to it a pattern (like *.wav
or whatever the files are named). It will return a list of files that match the criteria or the pattern.
import glob
from scipy.io.wavfile import read
wavs = []
for filename in glob.glob('*.wav'):
print(filename)
wavs.append(read(filename))