file does not start with RIFF id
在TIMIT数据读取时不能直接读取出现 "file does not start with RIFF id" 这时需要python 转化sphere格式为wav格式
from sphfile import SPHFile
import osdef get_wave_path(wav_path):wave_files = []for (dirpath, dirname, filenames) in os.walk(wav_path):for filename in filenames:if filename.endswith('.wav') or filename.endswith('.WAV'):filename_path = os.sep.join(dirpath, filename)wave_files.append(filename_path)return wave_filesdef sphfile_trans_to_wave(wave_file):for wav in wave_file:file = SPHFile(wav)file.write_wav(filename=wav)if __name__ == '__main__':wave_path = ''wave_file = get_wave_path(wave_path)sphfile_trans_to_wave(wave_file)
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
