<div dir="ltr"><div>Something like this might work for you:</div><div><br></div><div>gst-launch-1.0 \<br> interleave name=i ! wavenc ! filesink location=test.wav \<br> audiotestsrc wave=0 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \<br> audiotestsrc wave=2 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \<br> audiotestsrc wave=0 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \<br> audiotestsrc wave=2 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i.</div><div><br></div><div>it's just using 4 different audiotestsrc elements, and with the capsfilters, force them to produce mono audio which gets interlaced into 1 stream before being written to the file. Right now, this will run infinitely, so you might want to set the num-buffers property on the audiotestsrc elements to limit them.</div><div><br></div><div>--Chris<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 14, 2021 at 6:03 AM Nick_law <<a href="mailto:nicholas@umantec.net">nicholas@umantec.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Really struggling to work out how one would generate 2 audiotestsrc and then<br>
map/duplicate them to multiple channels.<br>
<br>
i.e <br>
a sine wave on channel 1,3<br>
a sawtooth on channel 2,4 <br>
<br>
or<br>
a sine wave on channel 1,4<br>
a sawtooth on channel 2,3 <br>
<br>
Here there are 4 channels (but 5 would also be good):<br>
<br>
My working example of generating two tones is below:<br>
<br>
gst-launch-1.0 interleave name=i \<br>
audiotestsrc wave=0 freq=100 volume=0.4 ! decodebin ! audioconvert ! \<br>
"audio/x-raw,format=S16BE,channels=1,channel-mask=(bitmask)0x1" ! queue !<br>
i.sink_0 \<br>
audiotestsrc wave=2 freq=100 volume=0.4 ! decodebin ! audioconvert ! \<br>
"audio/x-raw,format=S16BE,channels=1,channel-mask=(bitmask)0x1" ! queue !<br>
i.sink_1 \<br>
i.src ! capssetter<br>
caps="audio/x-raw,format=S16BE,channels=6,channel-mask=(bitmask)0x3f" \<br>
! audioconvert ! audioresample ! wavenc ! filesink location=test.wav <br>
<br>
I though that setting the bitmask for each source and channels (0xa and 0x5)<br>
would allow gstreamer to populate the correct amount of channels and the<br>
correct signals mapped but alas no go: What I tried was:<br>
<br>
gst-launch-1.0 interleave name=i \<br>
audiotestsrc wave=0 freq=100 volume=0.4 ! decodebin ! audioconvert ! \<br>
"audio/x-raw,format=S16BE,channels=2,channel-mask=(bitmask)0xA" ! queue !<br>
i.sink_0 \<br>
audiotestsrc wave=2 freq=100 volume=0.4 ! decodebin ! audioconvert ! \<br>
"audio/x-raw,format=S16BE,channels=2,channel-mask=(bitmask)0x5" ! queue !<br>
i.sink_1 \<br>
i.src ! capssetter<br>
caps="audio/x-raw,format=S16BE,channels=4,channel-mask=(bitmask)0xf" \<br>
! audioconvert ! audioresample ! wavenc ! filesink location=test.wav <br>
<br>
but I get<br>
WARNING: erroneous pipeline: could not link queue0 to i<br>
<br>
I also tried setting the tone channels to 4 with the same bitmask<br>
<br>
I have also tried an audio convert after i.sink_0 and i.sink_1 also with no<br>
luck.<br>
<br>
Is this even possible? Any help would be much appreciated. <br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>