I am new in Python programming and I need your help to advice me.
I want to transfer audio from RPI3 to my PC by writing a python program.
I found a good tutorial on audio client/server using udp but I confused about the functionality of UDP of sending audio.
Does anyone can explain how the audio transferred using UDP and where is the functionality of RTP which is using for streaming.
I used this python program for sending audio:
from threading import Thread
frames = 
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(frames) > 0:
udp.sendto(frames.pop(0), ('127.0.0.1', 42345))
def record(stream, CHUNK):
if __name__ == "__main__":
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
p = pyaudio.PyAudio()
stream = p.open(format = FORMAT,
channels = CHANNELS,
rate = RATE,
input = True,
frames_per_buffer = CHUNK,
Tr = Thread(target = record, args = (stream, CHUNK,))
Ts = Thread(target = udpStream)