我已经录制了一个音频文件,我正在将该文件转换为base64格式。现在我想将此音频文件写入fifo文件。 代码如下:
import os
import base64
import select
os.system("mkfifo audio1.fifo")
with open("audio1.fifo") as fifo:
select.select([fifo],[],[fifo])
with open("out1.wav","rb") as audioFile:
str = base64.b64encode(audioFile.read())
fifo.write(str)
但上面的代码只创建fifo文件,而不在其中写入任何内容。请给出任何建议
使用
+
模型可以同时支持读写同时读取和写入两个不同的文件:
相关问题 更多 >
编程相关推荐