我正在尝试编写一种将.m4a文件转换为另一种格式(如.wav )的方法。我使用了模块SpeechRecognition,但它不起作用。我的文件确实出现在我的打印语句中,所以我知道文件通过了。我的代码如下。请帮忙,谢谢!
print(file)
song = AudioSegment.from_m4a(file)
song.export("audioexport.wav", format="wav")错误: AttributeError:类型对象'AudioSegment‘没有属性'from_m4a’
发布于 2019-08-17 02:57:19
from_m4a不是函数。我认为m4a不受支持。尝试不同的格式,然后使用from_file函数:
AudioSegment.from_file(file, "mp3")https://stackoverflow.com/questions/57529616
复制相似问题