问题
I want to do real time voice transmission through uart of two raspberry pi 3b.Currently I am able to transmit the real time voice through uart by recording the audio in fifo file and at the same time writing that file to uart(Tx). But at receiving side I am not able to receive data properly.The code i am using is as below.
import os
import serial
import select
ser=serial.Serial('/dev/ttyS0',19200)
os.system('mkfifo audio1.fifo')
with open('audio1.fifo') as fifo:
while True:
select.select([fifo],[],[fifo])
x=ser.readline()
x=fifo.write()
Above code is only creating fifo file but not writing in it.As well ,I also want to do that when it start writing in it it should play audio on 3.5mmm jack. Plz give me some suggestions/corrections.
来源:https://stackoverflow.com/questions/59676120/receiving-data-through-uart-in-raspberry-pi-3b