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 '<font class="Apple-style-span" color="#FF0000">resmux</font>'. This code does work without the caps filter '<font class="Apple-style-span" color="#FF0000">resmux</font>'.</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 ("audio-player");</div><div> source = gst_element_factory_make ("filesrc", "file-source");</div>
<div> sink = gst_element_factory_make ("alsasink", "audio-output");</div><div> resample = gst_element_factory_make ("audioresample", "audio-resample");</div><div> conv = gst_element_factory_make ("audioconvert", "converter1");</div>
<div><br></div><div> caps = gst_caps_new_simple ("audio/x-raw-int",</div><div> "width", G_TYPE_INT, 16,</div><div> "depth", G_TYPE_INT, 16,</div>
<div> "rate", G_TYPE_INT, 22050,</div><div> "channels",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 ("NO MEM Exiting.\n");</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), "location", filePath, NULL);</div>
<div><br></div><div> demuxer = gst_element_factory_make ("id3demux", "id3-demuxer");</div><div> decoder = gst_element_factory_make ("mad", "mp3-decoder");</div><div>
<br></div><div> if (!demuxer || !decoder || !conv1)</div><div> {</div><div> g_print ("NO MEM Exiting.\n");</div><div> return 1;</div><div> }</div><div>
<br></div><div> g_object_set (G_OBJECT (resmux), "caps", caps, NULL);</div><div> gst_caps_unref (caps);</div><div><br></div><div> /* file-source -> demuxer -> decoder -> 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, "pad-added", 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>"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."<br>
"Anyone who has never made a mistake has never tried anything new."<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"><<a href="/user/SendEmail.jtp?type=node&node=3213856&i=0" target="_top" rel="nofollow">[hidden email]</a>></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'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, "Jesu Anuroop Suresh" <<a href="http://user/SendEmail.jtp?type=node&node=3213735&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>> wrote:<br type="attribution">
> <br>> Hi All,<br>> <br>> Does anyone tried the pipeline for audioresample using C.<br>
> <br>> gst-launch -vvv filesrc location=01_Pepercut.mp3 ! id3demux ! mad ! <br>> audioconvert ! audioresample !<br>> audio/x-raw-int,width=16,rate=22050,channels=1,depth=16,signed=true,endianness=1234<br>> ! alsasink<br>
> <br>> Thanks and regards<br>> Jesu Anuroop Suresh<br>> <br>> -- <br>> 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>
> Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>> <br>> ------------------------------------------------------------------------------<br>> 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></div>> <a href="http://user/SendEmail.jtp?type=node&node=3213735&i=1" rel="nofollow" target="_blank" link="external">[hidden email]</a><div class="im"><br>
> <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&node=3213735&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&node=3213586&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>