For mp3 it works fine. <br><br>For wav and raw pcm files&nbsp; program never get signal handoff.<br>To play wav file I used dynamic pad and for pcm doesn&#39;t need pad.<br><br>Is it possible to play binary data using this approach? If so what would be the decoder elements. <br>
<br>I have looked into appsrc plugin . I ran the example given as part of the plugin. Audio is not coming.<br><br>Thanks,<br><span class="sg">Akbar</span><span></span> <br><br>
<div><span class="gmail_quote">On 7/12/08, <b class="gmail_sendername">Stefan Kost</b> &lt;<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">hi,<br>Akbar Basha schrieb:<span class="q"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Stefan,<br><br>Thanks for the response .<br></blockquote><br></span>Would you please post to the list. 
<div><span class="e" id="q_11b16b9620c3efc6_3"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I tried the same. But could not produce the result.<br><br>Please find the code.<br><br>static void<br>
cb_handoff (GstElement *fakesrc,<br>&nbsp; &nbsp; &nbsp; &nbsp;GstBuffer &nbsp;*buffer,<br>&nbsp; &nbsp; &nbsp; &nbsp; gpointer &nbsp; &nbsp;user_data)<br>{<br>&nbsp; &nbsp;/* Clip start and end */<br><br>&nbsp;data = (guint8 *) g_malloc (3000);<br>&nbsp;GST_BUFFER_SIZE (buffer) = 3000;<br>&nbsp;GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer) = data;<br>
&nbsp; &nbsp;FILE* fp = fopen(&quot;vertigo.mp3&quot;,&quot;rb&quot;);<br>&nbsp;if(fp == NULL)<br>&nbsp; {<br>&nbsp; &nbsp;printf( &quot; File is not opened \n&quot;);<br>&nbsp; &nbsp;return;<br>&nbsp; }<br>&nbsp;fread(data,3000,1,fp);<br>&nbsp; &nbsp;fclose(fp);<br>&nbsp;}<br><br>gint<br>
main (gint &nbsp; argc,<br>&nbsp; &nbsp; &nbsp;gchar *argv[])<br>{<br>&nbsp;GstElement *pipeline, *fakesrc, *flt, *conv, *audiosink;<br>&nbsp;GMainLoop *loop;<br><br>&nbsp;/* init GStreamer */<br>&nbsp;gst_init (&amp;argc, &amp;argv);<br>&nbsp;loop = g_main_loop_new (NULL, FALSE);<br>
<br>&nbsp;/* setup pipeline */<br>&nbsp;pipeline = gst_pipeline_new (&quot;pipeline&quot;);<br>&nbsp;fakesrc = gst_element_factory_make (&quot;fakesrc&quot;, &quot;source&quot;);<br>&nbsp;flt = gst_element_factory_make (&quot;capsfilter&quot;, &quot;flt&quot;);<br>
&nbsp;conv = gst_element_factory_make (&quot;mad&quot;, &quot;conv&quot;);<br>&nbsp;audiosink = gst_element_factory_make (&quot;alsasink&quot;, &quot;audiosink&quot;);<br><br>&nbsp;/* setup */<br>&nbsp;g_object_set (G_OBJECT (flt), &quot;caps&quot;,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_caps_new_simple(&quot;audio/x-raw-int&quot;,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;channels&quot;, G_TYPE_INT, 2,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;rate&quot;, G_TYPE_INT, 32000,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;depth&quot;, G_TYPE_INT, 16, NULL), NULL);<br>
</blockquote><br></span></div>This is obviously wrong. You load an mp3 and not raw audio data. The capsfilter needs to tell that. But in your case you would not even need one.<span class="q"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>&nbsp;gst_bin_add_many (GST_BIN (pipeline), fakesrc, flt,conv, audiosink, NULL);<br>&nbsp;gst_element_link_many (fakesrc, flt,conv, audiosink, NULL);<br>
<br>&nbsp;/* setup fake source */<br>&nbsp;g_object_set (G_OBJECT (fakesrc),&quot;signal-handoffs&quot;, TRUE,NULL);<br><br>&nbsp;g_signal_connect (fakesrc, &quot;handoff&quot;, G_CALLBACK (cb_handoff), NULL);<br><br>&nbsp;/* play */<br>&nbsp;gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
&nbsp;g_main_loop_run (loop);<br><br>&nbsp;/* clean up */<br>&nbsp;gst_element_set_state (pipeline, GST_STATE_NULL);<br>&nbsp;gst_object_unref (GST_OBJECT (pipeline));<br><br>&nbsp;return 0;<br>}<br><br>Even if I set using memset . Audio is not coming.<br>
</blockquote><br></span>What happens?<br><br>Stefan<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="q"><br>how to proceed in the case pad is required &nbsp;i.e for wav files.<br><br>Regards,<br>Akbar<br>
<br></span>
<div><span class="e" id="q_11b16b9620c3efc6_8">On Wed, Jul 9, 2008 at 11:53 PM, Stefan Kost &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a> &lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a>&gt;&gt; wrote:<br>
<br>&nbsp; &nbsp;Akbar Basha schrieb:<br><br>&nbsp; &nbsp; &nbsp; &nbsp;Hi,<br><br>&nbsp; &nbsp; &nbsp; &nbsp;I would like to play the buffer , which is filled with any audio<br>&nbsp; &nbsp; &nbsp; &nbsp;file data.<br>&nbsp; &nbsp; &nbsp; &nbsp;Does gstreamer provides any mechanism to play.<br><br><br>&nbsp; &nbsp;if you have the whole bufer in memory, use a fakesrc with<br>
&nbsp; &nbsp;signal-handoffs=TRUE and connect to handoff signal. In the handoff<br>&nbsp; &nbsp;signal you put the pointer to your data into the GST_BUFFER_DATA,<br>&nbsp; &nbsp;set the correct GST_BUFFER_SIZE and clear GST_BUFFER_MALLOC_DATA (if<br>&nbsp; &nbsp;it was previously set g_free() the previous content).<br>
<br>&nbsp; &nbsp;You should used a capsfilter after fakesrc and set the format of<br>&nbsp; &nbsp;your sample on the capsfilter caps.<br><br>&nbsp; &nbsp;Its sort of a hack, but works fine.<br><br>&nbsp; &nbsp;Stefan<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp;Thanks in advance.<br><br>
&nbsp; &nbsp; &nbsp; &nbsp;Regards,<br>&nbsp; &nbsp; &nbsp; &nbsp;Akbar<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br><br>&nbsp; &nbsp; &nbsp; &nbsp;-------------------------------------------------------------------------<br>&nbsp; &nbsp; &nbsp; &nbsp;Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!<br>
&nbsp; &nbsp; &nbsp; &nbsp;Studies have shown that voting for your favorite open source<br>&nbsp; &nbsp; &nbsp; &nbsp;project,<br>&nbsp; &nbsp; &nbsp; &nbsp;along with a healthy diet, reduces your potential for chronic<br>&nbsp; &nbsp; &nbsp; &nbsp;lameness<br>&nbsp; &nbsp; &nbsp; &nbsp;and boredom. Vote Now at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.sourceforge.net/community/cca08" target="_blank">http://www.sourceforge.net/community/cca08</a><br>
<br><br>&nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br><br>&nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>&nbsp; &nbsp; &nbsp; &nbsp;gstreamer-devel mailing list<br><br>&nbsp; &nbsp; &nbsp; &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
</span></div>&nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a>&gt;<span class="q"><br>
&nbsp; &nbsp; &nbsp; &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br>
<br><br></span></blockquote><br></blockquote></div><br>