TypeError: sequence item 0: expected str instance, bytes found

刚跟着教程学习PyAudio的录音,运行到保存时保存时报错TypeError: sequence item 0: expected str instance, bytes found

wf.writeframes("".join(data))

改为

wf.writeframes(b"".join(data))

成功录音

你可能感兴趣的:(树莓派,python)