How to generate 2 audio tones and map to specific channel positions (bitmask)

Chris Wine chriswine at gmail.com
Fri Jan 15 05:37:53 UTC 2021


Ok, I see. You probably don't need to worry about the performance too much
of the audio generation, unless you're really resource constrained,
nevertheless, you can use the tee element to use the generated source
multiple times:

gst-launch-1.0 \
  interleave name=i ! wavenc ! filesink location=test.wav \
  audiotestsrc wave=0 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! tee
name=t1 \
  audiotestsrc wave=2 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! tee
name=t2 \
  t1. ! queue ! i. \
  t2. ! queue ! i. \
  t1. ! queue ! i. \
  t2. ! queue ! i.


On Thu, Jan 14, 2021 at 9:11 PM Nick_law <nicholas at umantec.net> wrote:

> Chris Wine wrote
> > Something like this might work for you:
> >
> > gst-launch-1.0 \
> >   interleave name=i ! wavenc ! filesink location=test.wav \
> >   audiotestsrc wave=0 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \
> >   audiotestsrc wave=2 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \
> >   audiotestsrc wave=0 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i. \
> >   audiotestsrc wave=2 freq=100 volume=0.4 ! audio/x-raw,channels=1 ! i.
> >
> > 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.
> >
> > --Chris
>
>
> I am actually currently doing this but I think this is not the most
> efficient way?
>
> For example I may create 25 channel audio that may play a filesrc on some
> channels, and audiotst src on others.
>
> My thinking it will require less computation to create a few sources and
> duplicate them accordingly rather than recreating each source multiple
> times.
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210114/4a676dcb/attachment.htm>


More information about the gstreamer-devel mailing list