Hi Sean,<div><br></div><div>Yes, what I was trying is to resample the decoded mp3 data to the fixed (22KHZ S16LE) formate, </div><div><br></div><div>no matter what is the input rate using <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(80, 0, 80); ">a C application.</span></div>
<div><br></div><div>Thanks for your response.</div><div><br></div><div>Here is the piece of the code for the same but it does not work  with audioresample with the caps filter &#39;<font class="Apple-style-span" color="#FF0000">resmux</font>&#39;. This code does work without the caps filter &#39;<font class="Apple-style-span" color="#FF0000">resmux</font>&#39;.</div>
<div><br></div><div><div><div>        GstElement *source, *demuxer, *decoder, *conv, *sink, *resample, *resmux;</div><div>        GstCaps *caps;</div></div></div><div><br></div><div>        gst_init(NULL, NULL);</div><div>
<div><div><br></div><div>        /* Create gstreamer elements */</div><div>        musicPlayer.playPipeline = gst_pipeline_new (&quot;audio-player&quot;);</div><div>        source   = gst_element_factory_make (&quot;filesrc&quot;, &quot;file-source&quot;);</div>
<div>        sink     = gst_element_factory_make (&quot;alsasink&quot;, &quot;audio-output&quot;);</div><div>        resample = gst_element_factory_make (&quot;audioresample&quot;, &quot;audio-resample&quot;);</div><div>        conv     = gst_element_factory_make (&quot;audioconvert&quot;,  &quot;converter1&quot;);</div>
<div><br></div><div>        caps = gst_caps_new_simple (&quot;audio/x-raw-int&quot;,</div><div>                                     &quot;width&quot;, G_TYPE_INT, 16,</div><div>                                     &quot;depth&quot;, G_TYPE_INT, 16,</div>
<div>                                     &quot;rate&quot;,  G_TYPE_INT, 22050,</div><div>                                     &quot;channels&quot;,G_TYPE_INT, 2, NULL</div><div>                                     );</div>
</div><div><br></div><div>        if (!musicPlayer.playPipeline || !source || !sink ||</div></div><div><div>            !resample || !resmux || !caps || !conv)</div><div>        {</div><div>            g_print (&quot;NO MEM Exiting.\n&quot;);</div>
<div>            return 1;</div><div>        }</div><div><br></div><div>        /* we set the input filename to the source element */</div><div>        g_object_set (G_OBJECT (source), &quot;location&quot;, filePath, NULL);</div>
<div><br></div><div>        demuxer  = gst_element_factory_make (&quot;id3demux&quot;, &quot;id3-demuxer&quot;);</div><div>        decoder  = gst_element_factory_make (&quot;mad&quot;, &quot;mp3-decoder&quot;);</div><div>
<br></div><div>         if (!demuxer || !decoder || !conv1)</div><div>         {</div><div>                    g_print (&quot;NO MEM Exiting.\n&quot;);</div><div>                    return 1;</div><div>          }</div><div>
<br></div><div>         g_object_set (G_OBJECT (resmux), &quot;caps&quot;, caps, NULL);</div><div>         gst_caps_unref (caps);</div><div><br></div><div>         /* file-source -&gt; demuxer -&gt; decoder -&gt;  alsa-output */</div>
<div>        gst_bin_add_many (GST_BIN (musicPlayer.playPipeline),</div><div>                         source, demuxer, decoder, conv, resample, <font class="Apple-style-span" color="#FF0000">resmux</font>,sink, NULL);</div>
<div><br></div><div>        gst_element_link (source, demuxer);</div><div>        gst_element_link_many (decoder, conv, resample,<font class="Apple-style-span" color="#FF0000">resmux</font>,sink, NULL);</div><div><br></div>
<div>        g_signal_connect (demuxer, &quot;pad-added&quot;, G_CALLBACK (on_pad_added), decoder);</div><div><br></div></div><div><div>        GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(musicPlayer.playPipeline));</div>
<div>        gst_bus_add_watch(bus, bus_call, NULL);</div><div>        gst_object_unref(bus);</div><div><br></div><div>        gst_element_set_state(GST_ELEMENT(musicPlayer.playPipeline), GST_STATE_PLAYING);</div><div><br>
</div><div>        musicPlayer.playLoop = g_main_loop_new(NULL, FALSE);</div><div><br></div><div>        g_main_loop_run(musicPlayer.playLoop);</div><div><br></div><div>        gst_element_set_state(GST_ELEMENT(musicPlayer.playPipeline), GST_STATE_NULL);</div>
<div>        gst_object_unref(GST_OBJECT(musicPlayer.playPipeline));</div></div><div><br></div><div><br></div><div><br></div><div><br clear="all">With Warm Regards<br>Jesu Anuroop Suresh <br><br>&quot;Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction.&quot;<br>
&quot;Anyone who has never made a mistake has never tried anything new.&quot;<br><br><br><br><br>
<br><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 4:31 PM, Sean McNamara-4 [via GStreamer-devel] <span dir="ltr">&lt;<a href="/user/SendEmail.jtp?type=node&node=3213856&i=0" target="_top" rel="nofollow">[hidden email]</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">

        
                
                <p>Hi,</p>
<p>I don&#39;t entirely understand your question. Are you trying to convert a pipeline into an equivalent C application? Doing so is just based on understanding of C and the gstreamer C API... it is certainly possible, insofar as your pipeline is valid.</p>


<p>That said, look at gst_parse_* functions for a way to enter a pipeline spec in the gst-launch syntax and get either a GstBin or a GstPipeline out of it.</p>
<p>Sean</p>
</div><div class="gmail_quote"><div><div></div><div class="h5">On Jan 12, 2011 4:20 AM, &quot;Jesu Anuroop Suresh&quot; &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=3213735&amp;i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>&gt; wrote:<br type="attribution">
&gt; <br>&gt; Hi All,<br>&gt; <br>&gt; Does anyone tried the pipeline for audioresample using C.<br>
&gt; <br>&gt; gst-launch -vvv filesrc location=01_Pepercut.mp3 ! id3demux ! mad ! <br>&gt; audioconvert  ! audioresample !<br>&gt; audio/x-raw-int,width=16,rate=22050,channels=1,depth=16,signed=true,endianness=1234<br>&gt; ! alsasink<br>

&gt; <br>&gt; Thanks and regards<br>&gt; Jesu Anuroop Suresh<br>&gt; <br>&gt; -- <br>&gt; View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/audioresample-tp3213586p3213586.html?by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/audioresample-tp3213586p3213586.html</a><br>

&gt; Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>&gt; <br>&gt; ------------------------------------------------------------------------------<br>&gt; Protect Your Site and Customers from Malware Attacks<br>

&gt; Learn about various malware tactics and how to avoid them. Understand <br>&gt; malware threats, the impact they can have on your business, and how you <br>&gt; can protect your company and customers by using code signing.<br>

&gt; <a href="http://p.sf.net/sfu/oracle-sfdevnl" rel="nofollow" link="external" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>&gt; _______________________________________________<br>&gt; gstreamer-devel mailing list<br>
</div></div>&gt; <a href="http://user/SendEmail.jtp?type=node&amp;node=3213735&amp;i=1" rel="nofollow" target="_blank" link="external">[hidden email]</a><div class="im"><br>
&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br></div></div>
<br>------------------------------------------------------------------------------
<br><div class="im">Protect Your Site and Customers from Malware Attacks
<br>Learn about various malware tactics and how to avoid them. Understand 
<br>malware threats, the impact they can have on your business, and how you 
<br>can protect your company and customers by using code signing.
<br><a href="http://p.sf.net/sfu/oracle-sfdevnl" rel="nofollow" link="external" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>_______________________________________________
<br>gstreamer-devel mailing list
<br></div><a href="http://user/SendEmail.jtp?type=node&amp;node=3213735&amp;i=2" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br><div class="im"><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
        
        <br>
        <br>
        </div><hr noshade size="1" color="#cccccc">
        <div style="color:#666666;font:11px tahoma,geneva,helvetica,arial,sans-serif">
                View message @ <a href="http://gstreamer-devel.966125.n4.nabble.com/audioresample-tp3213586p3213735.html?by-user=t" target="_blank" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/audioresample-tp3213586p3213735.html</a><br>
                
                To unsubscribe from audioresample, <a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=3213586&amp;code=amVzdWFzQGdtYWlsLmNvbXwzMjEzNTg2fDcwOTc3MzYyOA==&by-user=t" target="_blank" rel="nofollow" link="external">click here</a>.
        </div></blockquote></div><br></div>

<br><hr align="left" width="300">
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/audioresample-tp3213586p3213856.html">Re: audioresample</a><br>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br>