I have a compiled pipeline for working with a program in python. So far, I'm checking this pipeline in the console and came up with a strange result. If I try to play the resulting sound with a pipeline that has a pitch, I get only strange clicks, but if I remove the part with a pitch, I get a clean sound.
Generator command:
gst-launch-1.0 -v filesrc location=morse.wav ! wavparse ! audioconvert ! audioresample ! rtpL16pay ! udpsink host=127.0.0.1 port=4000
Receive command:
gst-launch-1.0 audiomixer name=mixer udpsrc name=src0 uri=udp://127.0.0.1:4000 caps="application/x-rtp, media=(string)audio, clock-rate=(int)4000, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96" ! tee name=app ! queue ! rtpL16depay ! mixer.sink_0 udpsrc name=src1 uri=udp://127.0.0.1:5001 caps="application/x-rtp, media=(string)audio, clock-rate=(int)4000, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96" ! queue ! rtpL16depay ! mixer.sink_1 mixer. ! tee name=t ! queue ! audioconvert ! audioresample ! audiorate ! pitch pitch=1.0 !audiopanorama name=panorama panorama=-1.00 ! autoaudiosink name=audio_sink app. ! queue ! appsink name=asink emit-signals=True
When using gstreamer in my program, I would like to shift as many options as possible to it, since it is much more reliable in my opinion.
The question is how to adjust the pitch and what is the reason that the pitch does not allow the command to work?
You may need to set encoding-name=L16 in udpsrc output caps:
Sender:
gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! audio/x-raw,format=S16BE ! rtpL16pay ! udpsink host=127.0.0.1 port=4000 -v
Receiver:
gst-launch-1.0 udpsrc port=4000 ! application/x-rtp,media=audio,encoding-name=L16,clock-rate=44100,format=S16BE ! rtpL16depay ! audioconvert ! autoaudiosink -v
[EDIT: This works fine on my side: Created 2 live sources:
gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! audio/x-raw,format=S16BE,rate=44100 ! rtpL16pay ! application/x-rtp,encoding-name=L16 ! udpsink host=127.0.0.1 port=4000 -v
gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! audio/x-raw,format=S16BE,rate=44100 ! rtpL16pay ! application/x-rtp,encoding-name=L16 ! udpsink host=127.0.0.1 port=5001 -v
Then used:
gst-launch-1.0 \
audiomixer name=mixer \
udpsrc name=src0 uri=udp://127.0.0.1:4000 caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96" ! tee name=app ! queue ! rtpL16depay ! queue ! mixer.sink_0 \
udpsrc name=src1 uri=udp://127.0.0.1:5001 caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96" ! queue ! rtpL16depay ! queue ! mixer.sink_1 \
mixer. ! tee name=t ! queue ! audioconvert ! audioresample ! audiorate ! pitch pitch=1.0 ! audiopanorama name=panorama panorama=-1.00 ! autoaudiosink name=audio_sink \
app. ! queue ! appsink name=asink emit-signals=True
without problem. What seems wrong is the low clock-rate in your pipeline. Try setting rate 44100 in caps after audioresample in senders.