I am trying to make a pipeline that does the following:
- Read from a microphone with
alsasrc
- Use only the first channel with
deinterleave
- Convert the audio to
audio/x-raw,format=S16LE,rate=16000,channels=1
- Use the result with
appsink
An example launch command is as follows:
gst-launch-1.0 alsasrc ! deinterleave name=d d.src_0 ! queue ! audioconvert ! appsink caps=audio/x-raw,format=S16LE,rate=16000,channels=1
(alsasrc
can be replaced with audiotestsrc
+ a caps filter representing the microphone capabilities for testing.)
When the microphone natively supports a 16kHz sample rate, this pipeline works without any issues. When the microphone does not support 16kHz, however (many only support 44.1kHz), the pad linking between deinterleave
and queue
fails.
It seems that the audioconvert
is not helping. How can I solve this issue? A pipeline graph taken after pad linking fails is included below.