Panning audio output
Federico Zamperini
fzamperini at tiscali.it
Wed Apr 18 12:50:05 PDT 2012
Il 15/04/2012 21:31, Stefan Sauer ha scritto:
> On 04/10/2012 05:50 PM, Federico Zamperini wrote:
>> Hi,
>> I have two audio pipelines (actually I have two playbin2, and I'd
>> like to keep them); I want to send one to the left audio channel and
>> one to the right one.
>> Does anyone know a way to accomplish this?
>>
>> FYI: I'm fiddling with audio-sink property of playbin2 and linking to
>> a {audiopanorama + autoaudiosink} bin with no success.
>
> What is not working? gst-launch playbin2 uri=...
> audio-sink="audiopanorama panorama=1.0 ! autoaudiosink" play the audio
> fully right for me (and -1.0 fully left).
>
> Stefan
Yes, the gst-launch pipeline was working, but the pipeline in my code
wasn't.
That's because I forgot to ghost the audiopanorama sink pad, and now
it's working even in my code. For posterity's sake here's the code
(error checking removed):
GstElement *autoaudiosink = gst_element_factory_make("autoaudiosink",
"autoaudiosink");
GstElement *audiopanorama = gst_element_factory_make("audiopanorama",
"audiopanorama");
GstElement *myaudiosink = gst_bin_new("myaudiosink");
gst_bin_add_many(GST_BIN(myaudiosink), audiopanorama, autoaudiosink, NULL);
gst_element_link(audiopanorama, autoaudiosink);
/* add audiopanorama sink pad to custom bin */
GstPad *pad = gst_element_get_static_pad(audiopanorama, "sink");
gst_element_add_pad (myaudiosink, gst_ghost_pad_new ("sink", pad));
gst_object_unref (GST_OBJECT (pad));
GstElement *pipeline = gst_element_factory_make("playbin2", player->name);
g_object_set(G_OBJECT(pipeline), "audio-sink", myaudiosink, NULL);
Thank you for your reply.
Cheers
Federico
More information about the gstreamer-devel
mailing list